[Tutor] Waiting for input.
Lloyd Kvam
lkvam@venix.com
Tue, 30 Oct 2001 18:04:15 -0500
Do you want an automatic pause?
import time
time.sleep(5) # sleep 5 seconds
http://www.python.org/doc/current/lib/module-time.html#l2h-1298
http://www.python.org/doc/current/lib/console-objects.html#l2h-567
Here you would issue a prompt and wait for user input.
reply = raw_input("Press enter when you are ready to continue!")
kromag@nsacom.net wrote:
>
> (I just found the range() function, so this will change soon! :-) It kinda
> works like I want it to at this point....)
>
> I would like to have the following function pause between loops:
>
> ------------------the following function------------------
> def do_r(self,_):
> saved=open('save','r')
> messagebase=cPickle.load(saved)
> saved.close()
> post=messagebase.keys()
> ticker=1
> count=len(messagebase)+1
> while ticker < count:
> post=messagebase[ticker]
> print 'nn Posted by: '+post[0]+'
> '+time.ctime(post[1])+'n'+post[2]
> ticker=ticker+1
>
> -----------------biting off more than I can chew..---------
>
> I keep scoping the Basic Statements chapter in "Learning Python" and have
> found nothing that seems to fit. Where do I need to look?
>
> Thanks folks!
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358
voice: 603-443-6155
fax: 801-459-9582