Python equivalent of IDL's stop and .reset

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-01-24T17:30:24Z Indexed on 2010/05/23 13:01 UTC
Read the original article Hit count: 497

Hi there, I'm relatively new to python but have a bit of experience using IDL. I was wondering if anyone knows if there are equivalent commands in python for IDL's stop and .reset commands.

If I'm running some IDL script I wrote that I put a stop command in, essentially what it does is stop the script there and give me access to the command line in the middle of the script. So I have access to all the functions and variables that I defined before the stop command, which I find really useful for debugging.

The .reset command I find extremely useful too. What it does is reset the the IDL environment (clears all variables, functions, etc.). It's as if I closed that session and opened a new one, but without having to exit and restart IDL. I find that if I'm trying to debug a script I wrote it's useful sometimes to start from scratch and not have to reset IDL (or python now). It would be useful also in python to be able to un-import any modules I had previously imported.

Any help with these issues would be greatly appreciated.

Cheers

Related

© Stack Overflow or respective owner

Related posts about python

Related posts about reset