Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • put a input("Hit enter to close.") before the exit() (which should be exit(0)) and after the print(statement) to make it wait ... Commented Oct 22, 2018 at 19:05
  • Works fine for me. Are you opening a command prompt window first and then running the script from inside the command prompt? Also you should be running it with python myfile.py, not just typing in the filename (which opens the file, not runs it). Commented Oct 22, 2018 at 19:09
  • Hi Patrick, thank-you for the quick response. It now waits for my input before closing, I'm fairly happy with that. Commented Oct 22, 2018 at 19:09
  • 1
    @Engineero, Yes I was doing exactly that, woops. Didn't realise I had to include python before my filename. Combining your suggestion and Patrick's it is doing what I want it to do now. At least I learned something! Commented Oct 22, 2018 at 19:13