I'm really new to this. I would like to send commands to a program (Dota 2) while it is still running.
So far this is what I have:
import subprocess
dota_exe = r'C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta\game\bin\win64\dota2.exe'
dota = subprocess.Popen([dota_exe], shell=True, \
stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, \
stderr=subprocess.STDOUT, )
Once the program is running (dota.poll() remains equal to None) I would like to be able to communicate with the program, that is, to know what it is doing. I would also like to send some commands (don't know if it's possible and I don't know which commands I could send, maybe these ones). Any suggestion or reference would be appreciated.