Skip to content

Instantly share code, notes, and snippets.

@sailfish009
Created May 30, 2020 05:41
Show Gist options
  • Save sailfish009/50f0ae9807e8b07edc06aef3387dd9c4 to your computer and use it in GitHub Desktop.
Save sailfish009/50f0ae9807e8b07edc06aef3387dd9c4 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