python - How to recover an ipython session with errors? -




i'm working ipython , manage crash (accidental ctrl-c, running out of battery…).

how can pick left when restarting it?

it logging already, , %rerun seems should want do, error made brings halt.

i use ipython (and sloppily…) "play" data , test ideas, things like

pla_df = orignal_very_long_and_complicated_name_df.copy() some_stuff = play_df.xs('foo', level = 'bar', axis = 1) nameerror: name 'play_df' not defined 

whoops, missed "y", i'll up-arrow twice , redo it:

play_df = orignal_very_long_and_complicated_name_df.copy() some_stuff = play_df.xs('foo', level = 'bar', axis = 1) 

happen quite , 1 of reasons why use ipython. if make small error, it's small key press or two, , can fix it, without causing trouble.

but %rerun stops @ error, instead of going through whole history, include fix it, 2 lines below.

how can %rerun run everything, line after line, no matter if 1 of lines throws error? cut out last line caused crash (i.e. looping myself out of memory) identifying %history -n ~1/1-~0/1 , doing %rerun ~1/1-345, don't see reason why %rerun works does.

and yes, can use technique identify non-critical error lines , skip them, in large session, way work.

edit: appears have issues commands produce on-screen output such whos use quite often, i'd expect that runs command , proceeds next.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -