communicate

How to Communicate between Two Animated Canvas Elements?

只愿长相守 提交于 2019-12-05 20:51:31
I want to communicate between two animated canvas elements. I’ve made two html5 canvas js animations with Adobe Animate CC. I’ve put both of these elements into one html page. I can successfully call functions from within those animations – the alerts are triggered successfully in the code below. I want to call functions from one animation to control the other animation. I need help knowing how to correctly call/name/address the animations. So far I get no response with the canvas_ship.gotoAndPlay(12); and canvas_car.gotoAndPlay(7); , and I've spent hours trying different references. I’m not a

Python subprocess with stdout redirect returning an int

我只是一个虾纸丫 提交于 2019-12-05 10:20:20
I am trying to read out data from a set of print statements in a C++ program that is being run using a subprocess. C++ code: printf "height= %.15f \\ntilt = %.15f \(%.15f\)\\ncen_volume= %.15f\\nr_volume= %.15f\\n", height, abs(sin(tilt*pi/180)*ring_OR), abs(tilt), c_vol, r_vol; e; //e acts like a print Python code: run = subprocess.call('Name', stdout = subprocess.PIPE, env={'LANG':'C++'}) data, error = run.communicate() However instead of getting the data, all I am getting is a single int, the exit code, either a 0 or an error code. Of course, python then tells me "AttributeError: 'int'

Python Capture reply from powershell

有些话、适合烂在心里 提交于 2019-12-02 10:04:47
The code below works when typed manually however when I run the program.py nothing prints. My ultimate goal is to retrieve this data from user pc to create an easy way to recreate shortcuts.... My users somehow lose them lol import smtplib, os, subprocess, sys from string import ascii_uppercase from cStringIO import StringIO data = os.popen(r"dir %userprofile%\desktop\*.lnk* /s/b").read() file = open("testitem.txt", "w") file.write(data) file.close() my_data = dict(zip(ascii_uppercase,open("testitem.txt"))) old_stdout = sys.stdout sys.stdout = mystdout = StringIO() for key, value in my_data

How do I communicate between python and a mac application?

为君一笑 提交于 2019-12-02 04:13:46
问题 This might be a vague question, but I failed to rephrase it properly. So here's an explanation. I developed an app that was originally developed as a Mac application, using API's from both Carbon/Cocoa to achieve my task. (The goal of the application is to send 'keystrokes' to an app after mouse movements / other keystrokes. I use Accessibility API's for that). But now, I want to add scripting support, so there can be conditional keystrokes. Such as: after 5 times of pressing 'Y', I want to

PyMySQL variables in queries

老子叫甜甜 提交于 2019-12-01 19:47:50
问题 I would like to have a connection between my python code and a SQL database. I have read several ways to do it , but I am failing to get the results. conn = pymysql.connect(user=X,passwd=X,host=X,port=X,database=X, charset='utf8', autocommit=True) curs = conn.cursor() try: curs.execute('SELECT id,sing_name,bir_yr FROM singers_list WHERE bir_yr = ? ',year) data = curs.fetchall() for i in data: yield " Data: " + str(i) + "<br/>" except: yield " Failed to get data from base<br/>" Where year is

PyMySQL variables in queries

老子叫甜甜 提交于 2019-12-01 18:06:58
I would like to have a connection between my python code and a SQL database. I have read several ways to do it , but I am failing to get the results. conn = pymysql.connect(user=X,passwd=X,host=X,port=X,database=X, charset='utf8', autocommit=True) curs = conn.cursor() try: curs.execute('SELECT id,sing_name,bir_yr FROM singers_list WHERE bir_yr = ? ',year) data = curs.fetchall() for i in data: yield " Data: " + str(i) + "<br/>" except: yield " Failed to get data from base<br/>" Where year is an int python variable. I am getting the proper results with: curs.execute('SELECT id,sing_name,bir_yr

how to communicate with R through VBnet( or C#)

穿精又带淫゛_ 提交于 2019-12-01 06:28:47
Recently, I Developed an Experiment Application with VB.net(in Windows platform), When the application collected the data,I want to use R to Analysis the data, But I don't know how to Communicate with R (In other word, I want to send R script to R in my own application ). I will appreciate if anyone could give me some suggetions or some reference documents. Thank you very much! I'd suggest you try R.NET . The blurb says: R.NET enables .NET Framework to collaborate with R statistical computing. R.NET requires .NET Framework 4 and native DLLs installed with R environment. You need no other extra

Using Python to run executable and fill in user input

╄→尐↘猪︶ㄣ 提交于 2019-11-29 02:33:24
I'm trying to use Python to automate a process that involves calling a Fortran executable and submitting some user inputs. I've spent a few hours reading through similar questions and trying different things, but haven't had any luck. Here is a minimal example to show what I tried last #!/usr/bin/python import subprocess # Calling executable ps = subprocess.Popen('fortranExecutable',shell=True,stdin=subprocess.PIPE) ps.communicate('argument 1') ps.communicate('argument 2') However, when I try to run this, I get the following error: File "gridGen.py", line 216, in <module> ps.communicate

Python3 subprocess communicate example

橙三吉。 提交于 2019-11-29 02:14:23
I'm new to subprocessing. I just need a really simple win32 example of communicate() between a parent.py and child.py . A string sent from parent.py to child.py, altered by child.py and sent back to parent.py for print() from parent.py. I'm posting this because examples I have found end up either not being win32 or not using a child which just confuses me. Thanks for you help. Here is a simple example as per your requirements. This example is Python 3.x (slight modifications are required for 2.x). parent.py import subprocess import sys s = "test" p = subprocess.Popen([sys.executable, "child.py

Python subprocess Popen.communicate() equivalent to Popen.stdout.read()?

给你一囗甜甜゛ 提交于 2019-11-28 17:14:33
Very specific question (I hope): What are the differences between the following three codes? (I expect it to be only that the first does not wait for the child process to be finished, while the second and third ones do. But I need to be sure this is the only difference...) I also welcome other remarks/suggestions (though I'm already well aware of the shell=True dangers and cross-platform limitations) Note that I already read Python subprocess interaction, why does my process work with Popen.communicate, but not Popen.stdout.read()? and that I do not want/need to interact with the program after