Python shuts down when I try to run a module

Neil Cerutti neilc at
Mon Jul 23 13:34:45 EDT 2018

On 2018-07-23, Calvin Spealman <cspealma at> wrote:
> This is an unfortunate property of running command line
> programs on Windows. If you run the script directly (like by
> double clicking on it?) the console window will close when the
> program is done, so you can't see the final output.
> To get around this you could run them in the IDLE editor, which
> comes with Python 3.7 for Windows, or you could open a windows
> command prompt and run your Python scripts from there.

You can also put

input("Press [Enter] to exit.")

at the end of your program, though unfortunately it doesn't help
when an error occurs, requiring you to put it in a finally block
to ensure it happens.

Neil Cerutti

More information about the Python-list mailing list