Created
May 16, 2022 14:09
-
-
Save code4lala/015d8bd85dcfc43a68df95a7fd6d2d25 to your computer and use it in GitHub Desktop.
This file contains 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
# python use system(3) as if c use int system(const char *command); in stdlib.h | |
def system(cmd, shell=True): | |
print('>', cmd) | |
pipe = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE) | |
pipe.wait() | |
text = pipe.communicate()[0] | |
print(text) | |
print('>', cmd, 'end') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment