Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created October 22, 2017 06:25
Show Gist options
  • Save paulwinex/7100079c410793fb2a4232c0260a7e86 to your computer and use it in GitHub Desktop.
Save paulwinex/7100079c410793fb2a4232c0260a7e86 to your computer and use it in GitHub Desktop.
"""
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