communicate

Communicate between pages in wpf

亡梦爱人 提交于 2019-12-11 02:38:51
问题 I have two Pages and one MainWindow.. I load the Pages in two Frames.. Now I want to execute methods from each other.. How can I do this? This is Page1.cs: public partial class Page1 : Page { public Method1() { doSomething; } } This is Page2.cs: public partial class Page2 : Page { public Method2() { doSomethingElse; } } In my MainWindow the following happens: Frame1.Source = new Uri("/Source/Pages/Page1.xaml", UriKind.RelativeOrAbsolute); Frame2.Source = new Uri("/Source/Pages/Page2.xaml",

Python, mpg123 and subprocess not properly using stdin.write or communicate

折月煮酒 提交于 2019-12-11 01:09:12
问题 ok, so my google-fu really kind of sucks and I was unable to find an answer, hopefully you folks can help me ^_^ ok, so what I thought would be a simple script is seemingly not communicating with its subprocess correctly, I'm running this line by line. I'm also using the mpg123 player, this is a Linux system (well, Raspberry Pi) from subprocess import Popen, PIPE, STDOUT p = Popen(["mpg123", "-C", "test.mp3"], stdout=PIPE, stdin=PIPE, stderr=STDOUT) #wait a few seconds to enter this, "q"

How to communicate between WPF and JavaScript in a WebBrowser instance?

帅比萌擦擦* 提交于 2019-12-10 03:47:12
问题 I have a C#/WPF application with an embedded browser (WebBrowser) with some JavaScript. How can they communicate with each other in both directions? Is it practicable to use the URL? JS->WPF: Listen for changes. WPF->JS: Change the URL to javascript:alert('hello'); Is there a better way? 回答1: It's important to know that there are two WebBrowser. One for Windows Forms and one for WPF. The link below uses the WPF one. http://www.dotnetfunda.com/articles/article840-working-with-webbrowser-in-wpf

Python subprocess communicate freezes when reading output

♀尐吖头ヾ 提交于 2019-12-08 10:03:07
问题 I'm using Gphoto2 to take pictures on a DSLR. As its based on bash commands I tried to use subprocess.communicate but it freezes after the camera takes a picture. If I try the gphoto2 --capture-image-and-download in the terminal it takes less than 2 seconds. I'm working on a Raspberry Pi. Code: import subprocess class Wrapper(object): def __init__(self, subprocess): self._subprocess = subprocess def call(self,cmd): p = self._subprocess.Popen(cmd, shell=True, stdout=self._subprocess.PIPE,

How to send the password after user name in command prompt using python

ぐ巨炮叔叔 提交于 2019-12-08 03:29:49
问题 Trying to run some windows application in a specific user mode. After passing the command, it will ask for password. So passing the password using proc.communicate() but its not working, Please help from subprocess import Popen, PIPE import time cmd = "runas /user:administrator notepad.exe" proc = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE) print proc.stdout.read() proc.communicate('password') 回答1: Are you open to using Pexpect instead? If yes, you can use the following: import pexpect

How to communicate 'externally' between Adobe Animate CC animations?

橙三吉。 提交于 2019-12-07 20:50:26
问题 From the script in the html page, I'm trying to control what happens in the Adobe Animate CC animations I've created. For example, here you'll see a script that doesn't work that's trying to tell the ship animation to gotoAndPlay(5). Anyhow, the ship animation is not responding to that. I'm guessing it's because I'm not addressing/naming it correctly. Help me talk to my animations. See the code below. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Lets talk to each other</title>

How to Communicate between Two Animated Canvas Elements?

拈花ヽ惹草 提交于 2019-12-07 12:42:00
问题 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

How to communicate 'externally' between Adobe Animate CC animations?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 13:16:19
From the script in the html page, I'm trying to control what happens in the Adobe Animate CC animations I've created. For example, here you'll see a script that doesn't work that's trying to tell the ship animation to gotoAndPlay(5). Anyhow, the ship animation is not responding to that. I'm guessing it's because I'm not addressing/naming it correctly. Help me talk to my animations. See the code below. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Lets talk to each other</title> <script src="http://code.createjs.com/easeljs-0.8.1.min.js"></script> <script src="http://code.createjs

python 3 subprocess error in bytes

懵懂的女人 提交于 2019-12-06 03:29:30
问题 Very good, I have a little problem with the output of the thread, I get in unicode or I think and not let me convert it to utf-8, this is the code: import subprocess,sys,time string = b'dir' process = subprocess.Popen('cmd.exe', shell=True,cwd="C:\\",stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=None) process.stdin.write(string) o,e=process.communicate() process.wait() process.stdin.close() print (o.encode('utf-8')) I jump the following error: **Traceback (most recent call last): File

PHP to Java communication [closed]

 ̄綄美尐妖づ 提交于 2019-12-06 02:49:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I want to use PHP to communicate with a java using shared database to communicate, please help me with sample code or logic. Thank you. EDIT: I appreciate your suggestions, Yes I will be using both php and java