Created
March 26, 2013 00:09
-
-
Save phihag/5242061 to your computer and use it in GitHub Desktop.
Example demo program for http://stackoverflow.com/q/15627049/35070
This file contains hidden or 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
import subprocess | |
with open("blah.txt",'wb') as f: | |
subprocess.call(['date'], stdout=f, stderr=subprocess.STDOUT) | |
f.flush() | |
print (open("blah.txt", 'rb').read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment