Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- def run_some_cmd(cmd: str, quiet: bool=False) -> None:
- stdouterr = open(os.devnull, 'w') if quiet else None
- try:
- subprocess.check_call(cmd, close_fds=True,
- stdout=stdouterr, stderr=stdouterr)
- finally:
- if stdouterr:
- stdouterr.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement