Skip to content

Instantly share code, notes, and snippets.

@sidja
Created December 22, 2016 02:51
Show Gist options
  • Save sidja/c5692a0cb236df307d5e2bb6345bbeb4 to your computer and use it in GitHub Desktop.
Save sidja/c5692a0cb236df307d5e2bb6345bbeb4 to your computer and use it in GitHub Desktop.

Revisions

  1. sidja created this gist Dec 22, 2016.
    7 changes: 7 additions & 0 deletions run_shell.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import subprocess


    def run(command):
    my_env = os.environ.copy()
    print(command)
    return subprocess.check_output(command, shell=True, env=my_env)