Last active
December 21, 2015 03:08
-
-
Save andreypopp/6239850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from imagination.tulip import subprocess | |
p = subprocess.run("somecmd", ["arg1", "arg2"]) | |
# process's pid | |
p.pid | |
# send signal to process | |
p.kill(subprocess.SIGINT) | |
# return_code is a tulip.futures.Future instance which resolves to process' return code on completion | |
p.return_code | |
def somecmd_done(return_code): | |
print("I'm done with %s" % return_code) | |
p.return_code.add_done_callback(somecmd_done) | |
# stdout, stderr are instances of tulip.streams.StreamReader | |
p.stdout, p.stderr | |
# stdin implements tulip.transports.WriteTransport | |
p.stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment