Python Forum
How can I move in an external program via Python? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How can I move in an external program via Python? (/thread-15004.html)



How can I move in an external program via Python? - Pythoner - Dec-29-2018

Hello,

I would like to ask a question about controlling a program via Python.

I can open an external program or file with subprocess command in Python. But how can I control this external program I opened?

For example, I want to use the File - Open command in this external program which I opened via Python. Or I want to open a script, which is written for this external program, and run it again in that external program.

Pyautogui can come to mind, but I'm looking for more than the mouse control. I need to use command of external program. Anybody have any experience on the subject?

Example:

import subprocess
subprocess.Popen(r'"C:\Program Files\...\....exe"', shell=True)
#I opened the program
#Now, I need to open a file in this external program. I have to use File - Open.
#How can I move or write a command?

I would like to read if the question has been asked earlier or if there is a similar issue. I want to go ahead on this topic as far as I can.