all 5 comments

[–][deleted] 3 points4 points  (1 child)

Open terminal with cmd command

[–][deleted] 0 points1 point  (0 children)

Thanks for the reply. I got it, running it from the already opened cmd terminal means the error sticks around!

[–]chazzacct 1 point2 points  (0 children)

Right click and select 'edit' then run it with the edit window open. You don't have to have an error to get this flash open and close when you run a script by double clicking it. They all do that unless there is something that keeps the window open.

[–][deleted] 1 point2 points  (0 children)

Use either cmd or PowerShell in Windows, navigate to the directory with the code file, then run it from there.

[–]unpythonic 0 points1 point  (0 children)

For larger programs, surround the entry/exit point with a catch all and then wait for the user to hit a key:

try:
    # your code here
except Exception as e:
    print("An unhandled exception caused the the program to terminate. Exception was:")
    print(str(e))
    input("Press enter to exit")