Skip to content

Instantly share code, notes, and snippets.

@rsmahmud
Created December 10, 2017 04:52
Show Gist options
  • Save rsmahmud/fae59ff578daa8b514abff30fed16dc6 to your computer and use it in GitHub Desktop.
Save rsmahmud/fae59ff578daa8b514abff30fed16dc6 to your computer and use it in GitHub Desktop.
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