PS0: I think I wrote all the code OK, but then I saved it, and when I click it to open it, the command prompt pops up for a second then closes... is there a bug or something?
did you type in the extension .py? I was saving mine without extensions by accident because I didn't know you had to write them manually. If that's the problem, try just rename it and stick a '.py' at the end of it and it should open right up. A tell tale sign of this problem is if you you save it and then all the python color formatting vanishes (eg how 'if','while', and 'for' are orange)
I've had this problem too. Try going to task manager, stop all python processes, then open IDLE, and open your file from there.
You cannot launch a .py file by clicking on it. If you wish to do that you'll probably have to use a package like py2exe. However I wouldn't look into that until you're comfortable with python. If you are in Linux or Mac OSX you can simply cd to the directory your file is in and just run the command: python yourfile.py Alternatively you may use the IDLE interpreter, but I'm not a massive fan of that.
Please see one of these: http://docs.python.org/using/windows.html http://docs.python.org/using/unix.html http://docs.python.org/using/mac.html
I never save my files with the ".py" extension. Pulling it back up is as simple as running IDLE and going to File>Open>(find file)>Double-click.
All you have to do (in windows) is single click on the file, then right-click and choose "edit in IDLE". If you double-click the file name, then you have chosen to execute the file. But you cannot debug or edit the script from the command prompt window that it opens. If your program has a "raw_input()" line in it, then you can double click on the file and see how it executes. But if you don't it will open up, run at lightning speed, and close before you know what happened.
Weird. I've never had a problem opening them as long as I open it through IDLE.
Join our real-time social learning platform and learn together with your friends!