July 21st, 2007, 03:11 PM
Program ends to quickly
Just for an example:
print "Hello World\n"
It makes a black window appear, the words "Hello World" Pop up and the screen disappears almost to quickly to see it. How do I make it stay up until I tell it to end (i.e. Hit the enter key to close?)
I appreciate any help I can get.
July 21st, 2007, 05:38 PM
What you wrote is a console program, so you ideally you should open a command line and run it from there. Get used to doing so, as many of the programs and tools you will use will be command line programs.
But if you want to create a kludge and keep the window open, ask for user input. Doing something like kludge = gets at the end of the program will do the trick.
When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.
Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
Want better answers? Tell us what you Googled for and what steps you took to answer your own question.