Joe wrote:
I want the script to decide whether to fall back to the interactive prompt. You solution makes it ALWAYS fall back to the interactive prompt.
Actually, using sys.exit() means the program can exit even if python -i is used.
You can use:
import code code.interact()
which emulates the interactive prompt.
Unfortunately it does so in an entirely new namespace, thereby losing the advantage of -i - namely, that you can investigate the program's namespace after it's terminated.
regards Steve
-- http://mail.python.org/mailman/listinfo/python-list