Stop Python from exiting upon error in Windows

Robert at AbilitySys.com Robert at AbilitySys.com
Mon Jul 14 22:28:56 EDT 2003


Can you nest exceptions? I already have a few legitimate try/except blocks
where I know there's a chance the act could go bad, do I just stick a try:
at the beginning of the whole body of code and an except: at the end?

- Robert

"Tom Plunket" <tomas at fancy.org> wrote in message
news:n2o6hvcahk7dlmn9t26tvis8umnfg1tdeo at 4ax.com...
> Robert wrote:
>
> > How can I stop the Python interpreter from exiting when an error occurs?
>
> create a batchfile, tell Windows that the association of Python
> files is to that batch file, and put this in the file:
>
> python.exe %1
> pause
>
>
> Or- catch the error in your mainline, and do a sys.raw_input()
> call on exception.
>
> -tom!






More information about the Python-list mailing list