Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 16 Online
OpenStudy (anonymous):

Is it possible to bridge a button from an application to a different application? This is hard to ask due to my lack of terminology but here is the example scenario. Lets say you have a play button on a website like Pandora.com and you want to take that play button and add it to your python program so that you can use your python program and be working in that but then click the play button in your program and it will press the play button on Pandora.com without physically moving your mouse. What is this called and how would you even approach this in python? Thank you

OpenStudy (anonymous):

Without physically changing tabs or changing applications would be a better way to rephrase the last sentence.

OpenStudy (anonymous):

If you're only interested in buttons on web sites, you would be better off adding some sort of interface to your browser (such as an add-on/extension) that actually interacts with the web site for you. Those are written in JavaScript, and you would write it such that your python code is able to send through a message that triggers the click. The other moderately simple option is that your python program produces input to simulate user action, which means activating the correct window, then placing the mouse over the correct button and clicking it, all using python. You'd also want to give focus back to the other application and put the mouse back where it was. This could maybe be done fast enough to be unnoticeable, but if you're doing a lot like this, you're going to notice it. Note: For anything created in Adobe Flash, you're probably going to need to do it this way or not at all. For desktop application, there is another option, which requires a bit of "hacking" - unless the application is open source. What you'd have to do is find the event listener for your button in memory and send the signal that the button has been clicked to that listener (by changing the memory). This isn't really something you can do in python without first writing it in C anyway (python modules can be written in C).

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!