How can I make a program wait for a few seconds before proceeding? An example of where this would come in handy is when the program allows the user 5 seconds before it proceeds with some default option... can I do this using python?
mahela007
6
Posting Whiz in Training
Recommended Answers
Jump to PostTry:
time.sleep
Jump to Post>>> import time >>> dir(time) ['__doc__', '__name__', '__package__', 'accept2dyear', 'altzone', 'asctime', 'clock', 'ctime', 'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'strftime', 'strptime', 'struct_time', 'time', 'timezone', 'tzname'] >>> help(time.sleep) Help on built-in function sleep in module time: sleep(...) sleep(seconds) Delay execution for a given number of seconds. The argument may …
Jump to PostThanks... that's what I needed. However, I'd like to know HOW a timer is created in python.
Apart from the sleep function, there is a Timer class in the threading module and there are timers in gui modules like tkinter and wxpython. Other ways to wait are the threading.Condition.wait() function, …
All 9 Replies
slate
241
Posting Whiz in Training
snippsat
661
Master Poster
mahela007
6
Posting Whiz in Training
Gribouillis
1,391
Programming Explorer
Team Colleague
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
mahela007
6
Posting Whiz in Training
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
Gribouillis
1,391
Programming Explorer
Team Colleague
mahela007
6
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.