![]() ![]() Python's subprocess module enables parallel subprocess execution. Procs = ,cwd=Lcwd,shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE) for i in ] Subprocess.call(cmd2, cwd="/home/./Documents/pythonScriptFolder",shell=True,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) #execute python script to verify program 1 termination I've tried two subprocesses in a row: subprocess.call(cmd, cwd=current_working_directory,shell=True,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) #executes the program 1 I'd like to be able to run this python script at the same time as "program 1" but I can't. The aim is to ensure that when the python script detects that "program 1" has finished, it kills it. I've created a python script that reads this file every 60 seconds and detects when "program 1" has finished. I get an output.log file that fills up as "program 1" executes. But "program 1" never ends (I can't correct this because I don't have access to the source code of "program 1"). ![]() Subprocess.call(cmd, cwd=current_working_directory,shell=True,stdout=subprocess.DEVNULL,stderr=subprocess.STDOUT) My program executes another program, let's call it "program 1" with the command subprocess : ![]() I'm writing a python program to automate tasks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |