Skip to content

Instantly share code, notes, and snippets.

@jingzhehu
Created July 1, 2018 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jingzhehu/7f6d900a6d46a365a12c2583cc71522b to your computer and use it in GitHub Desktop.
Save jingzhehu/7f6d900a6d46a365a12c2583cc71522b to your computer and use it in GitHub Desktop.
Run bash command in Python
import shlex
import subprocess
def bash_cmd(command):
return subprocess.check_output(shlex.split(command))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment