Skip to content

Instantly share code, notes, and snippets.

@yinjimmy
Last active May 30, 2020
Embed
What would you like to do?
create backgroud process
import os, time, sys, subprocess
if len(sys.argv) == 2:
time.sleep(5)
print 'track end'
if sys.platform == 'darwin':
subprocess.Popen(['say', 'hello'])
else:
print 'main begin'
subprocess.Popen(['python', os.path.realpath(__file__), '0'], close_fds=True)
print 'main end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment