Created
December 22, 2016 02:51
-
-
Save sidja/c5692a0cb236df307d5e2bb6345bbeb4 to your computer and use it in GitHub Desktop.
Run shell commands via python
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 run(command): | |
my_env = os.environ.copy() | |
print(command) | |
return subprocess.check_output(command, shell=True, env=my_env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment