How do you use python scripts to interact with a certain window or client? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you use python scripts to interact with a certain window or client?

is there a specific module to interact with let's say a client for a game? is it even possible.

27th Nov 2016, 9:33 PM
Steven Harris
Steven Harris - avatar
6 Answers
+ 2
I suggest you better use AutoHotkey, not python to interact with a certain window or client. It was designed specially for this task.
28th Nov 2016, 11:52 AM
donkeyhot
donkeyhot - avatar
+ 1
if you want to communicate with existing software, written by someone else - extremely hard. you don't know if the program has ability to communicate at all. and even if it can - you might not know how, especially with proprietary soft. there is no "common and standard protocol", even you would make your own if you'd write it. maybe there is a chance of understanding a part of particular protocol for web-based apps by changing host and writing json listener on your local webserver, but there might be no use for it. some programs are pipe-friendly, like most of Linux utilities. some developers provide API for their web-services. it can be used, but you must understand what you are making and what for.
28th Nov 2016, 7:44 AM
Demeth
Demeth - avatar
0
You can use input() to get something from the user. For example: name = input("What is your name?") You can also get a number/integer from a user with int(input()). For example: num1 = int(input()) num2 = int(input()) print(num1 + num2)
28th Nov 2016, 1:12 AM
Grady
Grady - avatar
0
if you don't write both of them, it would be hard to know a communication protocol. programs can 'chat' through a pipe (it's like input/print, but with another program), they can send json data (especially if they are web-based). you never know if the program really has such function and how it is realized.
28th Nov 2016, 6:43 AM
Demeth
Demeth - avatar
0
that's what I was thinking demeth how do I find that communication protocol to communicate with the window or client I want to move on from writing to terminals and try automate some clicking tasks etc..
28th Nov 2016, 7:35 AM
Steven Harris
Steven Harris - avatar
0
thank you demeth for your time I will do some research
28th Nov 2016, 7:45 AM
Steven Harris
Steven Harris - avatar