Created
February 14, 2017 02:40
-
-
Save claymcleod/5c5cf3fa5094a2b68db4fc6bab377863 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
import subprocess | |
def cmd(line): | |
complete_cmd = subprocess.run( | |
line, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
return {'stdout': complete_cmd.stdout, 'stderr': complete_cmd.stderr} | |
print(cmd("echo 'hello, world'")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment