Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pause .py file
#1
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?
Reply
#2
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
Reply
#3
How do i import the time module?... I just started learning python today
Reply
#4
(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.
Reply
#5
Oh i figured it out! Thanks!
Reply
#6
you can also do something like
Code:
raw_input("Press Enter To Continue")
Reply
#7
yea and if you dont want to see the press enter just do
Code:
raw_input("")
Reply
#8
(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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)