til/Development/Python/subprocess.md

11 lines
191 B
Markdown
Raw Normal View History

2020-06-08 18:09:04 +00:00
# [subprocess](https://docs.python.org/3/library/subprocess.html)
```python
import subprocess
subprocess.run(["ls", "-a"])
# Stop when run error
subprocess.run(["exit 1"], check=True)
```