kangwonlee / kangwonlee/tutorial
Detect shell command error
- Dominant language
- Jupyter Notebook
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
* `git checkout ` does not raise an exception
* `out = !git checkout ` would capture the output error message but seems not exactly desirable as a tutorial
* `%%script bash --out stdout --err stderr` captures `stdout` and `stderr` respectively
## References
* https://stackoverflow.com/questions/35857230/ipython-raise-exception-when-a-shell-command-fails
* https://jakevdp.github.io/PythonDataScienceHandbook/01.05-ipython-and-shell-commands.html
* https://ipython.readthedocs.io/en/stable/interactive/magics.html#cellmagic-script
## Observation
* Following cell would raise an error
``` sh
%%bash --out stdout --err stdout
git checkout
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.