0

In python I know how to launch a command using subprocess.Popen

process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

what I have to do is: 1) call an executable .exe command, 2) then after that command is running within it call another command. So when I do 1) like this:

process = subprocess.Popen("C:\Automation\helpFiles\topCmd.exe", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

once that is running I need to run another command i.e state

how can I do it?

Ghost
  • 549
  • 8
  • 29
  • Will topCmd.exe take commands from its command line? – Stephen Rauch Jun 03 '18 at 23:32
  • yes so 1st you have to run xyz.exe once that command is launched then 2) you run another command i.e "state" or def those each have different results. for command "state" I will have to run it every 5 min to get periodic state. – Ghost Jun 04 '18 at 23:58
  • Just realized I dint quite answer your question, my apologies, topCmd.exe does not take any command arguments. So once topCmd.exe is launched then you run "state" periodically to get some information. – Ghost Jun 05 '18 at 03:16

0 Answers0