Support Forums
Pause .py file - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32)
+---- Thread: Pause .py file (/showthread.php?tid=1450)



Pause .py file - zenzul - 10-13-2009

Ok... I'm trying to make a program that will run a madlibs program. I have the file (with a text saved as .py)made but when I'm done it always closes before I can read the paragraph. Is there a way to pause it to show the last part without closing?


RE: Pause .py file - Gaijin - 10-13-2009

You can import the time module and then use
Code:
import time
print "Start a Pause"
time.sleep(10)
print "After 10 seconds"

wait 10 seconds before going on


RE: Pause .py file - zenzul - 10-13-2009

How do i import the time module?... I just started learning python today


RE: Pause .py file - Gaijin - 10-13-2009

(10-13-2009, 07:59 PM)zenzul Wrote: How do i import the time module?... I just started learning python today

I've updated the code above.


RE: Pause .py file - zenzul - 10-13-2009

Oh i figured it out! Thanks!


RE: Pause .py file - nevets04 - 10-14-2009

you can also do something like
Code:
raw_input("Press Enter To Continue")



RE: Pause .py file - Mr.FeellingLeSS - 10-20-2009

yea and if you dont want to see the press enter just do
Code:
raw_input("")



RE: Pause .py file - nevets04 - 10-23-2009

(10-20-2009, 10:51 AM)Mr.FeellingLeSS Wrote: yea and if you dont want to see the press enter just do
Code:
raw_input("")

That waorks, but how wil the user know what to do O.o