![]() ![]() ![]() If you want to execute it in Background I recommend you to use nohup output that would normally go to the terminal goes to a file called nohup.out import subprocess If you want to be sure that it has completed, run p.wait(). I made a python script which runs the perl script, using subprocess pope, but under this scenario, the prompt is returned until the entire. This alternative still lets you run the command in background but is safe because it uses the default shell=False: p = subprocess.Popen(command_list)Īfter this statement is executed, the command will run in background. I have a perl script which once executed, returns the prompt in a matter of few seconds, but script still works in background for several minutes (sometimes more than an hour). Don't do this unless command including thingy comes from sources that you trust. Using shell=True enables all of the shell's features. Since shell=True, the above uses command, not command_list. This will allow you to run command in background. If you want it to work with subprocess, you must specify shell=True like: subprocess.call(command, shell=True) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |