![]() As such, the parent program (for instance, a Python application) will create and manage a child process for this external program. Subprocess.Popen("nohup usr/local/bin/otherscript. A subprocess is the execution of a program or command as a process external to where it got launched. ![]() ![]() 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(). 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. Don't do this unless command including thingy comes from sources that you trust. However, my problem is that the correct way I have it written, the JVM starts and blocks the rest of the processes that happen after it. I'm writing an application in python that initiates a JVM in java by calling a shell script using a python subprocess. Using shell=True enables all of the shell's features. Start a background process in Python (10 answers) Closed 7 years ago. 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 |