Skip to content

Instantly share code, notes, and snippets.

@nmcspadden

nmcspadden/test.py

Created Dec 8, 2015
Embed
What would you like to do?
def run(cmd):
'''Runs a command with subprocess, printing output in realtime'''
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
while proc.poll() is None:
l = proc.stdout.readline()
print l,
print proc.stdout.read()
cmd = [
'/Applications/AutoDMG.app/Contents/MacOS/AutoDMG',
'-L', loglevel,
'build', templatepath,
'--download-updates',
'-o', dmg_output_path]
print "Full command: %s" % cmd
run(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.