On 18 June 2013 23:50, Jack Little <jacklittl...@yahoo.com> wrote: > I compiled a program in python, but the second I open it, there is a flash > of the error, but then the cmd window closes. >
I suspicion someone as new to Python, since I am, who is using Windows and getting the annoying Windows Flash ;') So in Detail: Go to the Windows entry box on lower left > type cmd for the DOS box > hit Enter > type python followed by the full path to your program. For instance, I would type: python c:/python33/jimprogs/sympystuff.py and hit Enter to see the printout of a program that illustrates a quadratic equation. Note that after you type python, the input file is to the python interpreter, which Doesn't need those nasty Windows backslashes, so you should use forward slashes. I have no idea why Bill Gates thought backslashes were kewl - maybe he has a really long right little finger. Or he was trying to pretend DOS was a better variant of Unix (hahahahahahahahahaha) Then you should see the result, or your syntax errors. Which you already did if you put pause at the bottom of your program. But this eliminates the need to keep doing that. After you see that, exit() from python back to the DOS box, then simply type python, and you get the interactive python interpreter, where you can fool around with basic python. You also get to see your syntax errors realtime, rather than the annoying DOS Flash. If you're not familiar with DOS, check out basic DOS commands on Google - you may need them. Us old fogeys, and hardcore programmers, know DOS, but I don't assume others do in a GUI-world But putting input() right after your program is easiest. As for sleep, as Dave mentioned, in case you didn't get to module imports, create a simple program like this: import time time.sleep(3) Or if you want to see more than a blank screen and wonder if sleep is working: import time print('time to go to sleep') time.sleep(5) print('darn alarm clock') One can later use IDLE or Wing 101 for more complex programs (google them), but it really is good to know how to use DOS first. And if you're not using Windows, all this typing will be useful to someone else. But Bayesian inference tells me you most likely are ;') Jim Sci-fi novel in one line: Congratulations miss, you have twins - but one is dark matter. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor