Check the exit status of last command in ipython
问题 Does anybody know how to check the status of the last executed command (exit code) in ipython? 回答1: I assume that you are talking about running commands from IPython using the ! escape: In[1]: !echo hello hello In[2]: Using Google I found the documentation and there is no mention of the exit status of the command being captured anywhere. Using dir() I looked for a variable name that might be holding that information and I didn't find anything. I tried the x = !ls syntax and x gets set to a