Skip to content

Instantly share code, notes, and snippets.

@ekiara
Created December 11, 2019 05:51
Show Gist options
  • Save ekiara/c008d0cee59ece5c262ff2a489eb6ac5 to your computer and use it in GitHub Desktop.
Save ekiara/c008d0cee59ece5c262ff2a489eb6ac5 to your computer and use it in GitHub Desktop.
Invoking shell commands from Python and subprocess (either in the Python interpreter, or in a Python scipt)
# Invoking shell commands from Python and subprocess (either in the Python interpreter, or in a Python scipt) #
# python-subprocess-invoking-shell-commands #
>>> import subprocess
>>> subprocess.call(["whois", "example.co.ke"])
>>> subprocess.call(["whois", "-h" "registry.kenic.or.ke", "example.co.ke"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment