Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print command before executing it. #python
import subprocess
def do_it(cmd):
print(cmd)
subprocess.call([cmd], shell=True)
do_it("ls -al")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment