kamilpp
kamilpp

Reputation: 117

Is there "set -e" equivalent for ipython

set -e at the beginning of the bash script instructs bash to fail the whole script on first failure of any command inside.

Is there any equivalent to use with ipython script which invokes bash commands through !command?

Upvotes: 3

Views: 465

Answers (1)

Yann Vernier
Yann Vernier

Reputation: 15887

As noted in check the exit status of last command in ipython, there is an _exit_code variable. What you want to do is thus equivalent to adding an assert _exit_code==0 after each shell command. I have not found a feature to do the check automatically, but I'm not that familiar with ipython.

Upvotes: 2

Related Questions