Skip to content

Instantly share code, notes, and snippets.

@telliott99
Created December 17, 2015 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telliott99/c694e31aa0cca2e9c894 to your computer and use it in GitHub Desktop.
Save telliott99/c694e31aa0cca2e9c894 to your computer and use it in GitHub Desktop.
testing with python
import os, subprocess, time
for i in range(100):
print(str(i+1))
cmd = 'open -a "MyApp"'
p = subprocess.Popen(cmd, shell=True)
pid,ecode = os.waitpid(p.pid, 0)
if ecode != 0:
print "error"
break
time.sleep(5)
cmd = '''osascript -e 'quit app "MyApp"' '''
p = subprocess.Popen(cmd, shell=True)
time.sleep(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment