Created
July 10, 2018 16:00
-
-
Save FGtatsuro/4a31cd3c5f352491ba4d1dce4f5fd75c to your computer and use it in GitHub Desktop.
subprocess.run でシェル実行が簡単になる
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
# FYI: https://docs.python.org/ja/3/library/subprocess.html#subprocess.run | |
import subprocess | |
proc = subprocess.run(["find . -type f -name '*' | grep -v pycache"], | |
stdout=subprocess.PIPE, shell=True, encoding='utf-8') | |
print(f'status_code:{proc.returncode}') | |
print(proc.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment