Skip to content

Instantly share code, notes, and snippets.

@cnicolai
Last active March 4, 2024 19:38
Show Gist options
  • Save cnicolai/6c466d63838457ff3fe57dfe661734ce to your computer and use it in GitHub Desktop.
Save cnicolai/6c466d63838457ff3fe57dfe661734ce to your computer and use it in GitHub Desktop.
Run a shell script from python
import subprocess
# If arg3 is not a string, convert it to sringe before passing: arg3 = str(arg3)
subprocess.check_call(['/my/file/path/programname.sh', 'arg1', 'arg2', arg3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment