Last active
February 24, 2016 16:01
-
-
Save KamarajuKusumanchi/fd2d5d09d38bb5ecd313 to your computer and use it in GitHub Desktop.
Print command before executing it. #python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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