Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Window closes when opened
#1
I used to know how to prevent this, but now I haven't used python forever and I have no idea Confused

Does anyone know how to stop it from closing?
Reply
#2
You are double clicking the python file?
If so you are getting an error.

To stop it either use IDLE (The IDE that comes with Python) or run it through the command prompt.
Reply
#3
I found out a while ago, and yeah it was an error

But just for people who have problems with it closing right when it ends

Code:
import os
os.system("PAUSE")

makes it stay open until you close it
Reply
#4
Or you could use raw_input("") so the user has to press enter afterward.
Reply
#5
Pause does the same thing?
Reply
#6
If you put raw input you can close it by just pressing enter.
It's easier IMO.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to display variable serial data on Tkinter window. srinivas.rambha 0 1,029 06-17-2013, 05:54 AM
Last Post: srinivas.rambha

Forum Jump:


Users browsing this thread: 1 Guest(s)