Created
October 22, 2017 06:25
-
-
Save paulwinex/7100079c410793fb2a4232c0260a7e86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Start independed process | |
Dont use env argument | |
""" | |
import os, subprocess | |
cmd = ['executable', 'arg1', 'arg2', 'arg3'] | |
devnull = open(os.devnull, 'wb') | |
DETACHED_PROCESS = 0x00000008 | |
subprocess.Popen(cmd, stdout=devnull, stderr=devnull, creationflags=DETACHED_PROCESS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment