Piotr-Seeler
Aug 21 2008, 05:12 PM
Hello.. i was just doing a program on python ( on Idle more precisely ) and i saved it as a .py file.
When i run it from the windows explorer it quickly exits unless i add to the end of the code : "raw_input("press enter to exit")
anybody knows what to do?
Thank you
groovicus
Aug 21 2008, 05:29 PM
Does anybody know what to do to accomplish what exactly?
Piotr-Seeler
Aug 21 2008, 06:03 PM
ok... when i open the file from the folder it is contained... the program runs.
However.. the command prompt thus opened quickly closes without giving me the time to even read what was going on.
Is it clearer ?
groovicus
Aug 21 2008, 06:23 PM
So the question is, how do I get the command window to stay open so that I can see the results?
Easy. Open a command window, and run the file from the command line,
or 2, have the application pause while it waits for input (which you already did),
or 3, have the application pause for a set amount of time.
Piotr-Seeler
Aug 21 2008, 06:30 PM
yes you got it right

ok for 2.
for the first one... you mean that i open cmd?
for 3.. and how do i let it pause for a set amount of time?
groovicus
Aug 21 2008, 07:18 PM
QUOTE
you mean that i open cmd?
Yes.
QUOTE
and how do i let it pause for a set amount of time?
I have no idea what the syntax is in Python, but according to Google, Python has a sleep function.
Piotr-Seeler
Aug 24 2008, 08:55 AM
ok thank you for your answers
Piotr-Seeler
Aug 25 2008, 04:48 PM
i found it... u must import time. then use time.sleep(n)
n = number of seconds you wish to give.