Issue
I like to paste hunks of code into an ipython window during development and debug. I also have a situation where I want to stop execution if a condition happens:
if condition:
<stop running>
Solutions like sys.exit()
appear to exit all the way out of ipython back to a terminal prompt. Is there another way? At the moment I do this:
if condition:
fjklsd;
Which gives an error and returns to the ipython prompt, but is pretty ugly too.
Solution
You can raise this exception raise KeyboardInterrupt
Answered By - thomaslecouffe
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.