Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

Catch Exception thrown by python script launched from Jupyter Notebook

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:

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?

question from:https://stackoverflow.com/questions/65903516/catch-exception-thrown-by-python-script-launched-from-jupyter-notebook

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...