In my Jupyter Notebook I need to run a python script with some arguments and for doing this without using the subprocess module I'm using the following IPython magic in a cell:
subprocess
cmd = "python my_script.py --arg_1 1000 --arg_2 example" !eval {cmd}
Is there a way to catch the exceptions thrown by the script within the notebook?
2.1m questions
2.1m answers
60 comments
57.0k users