How to just wait 3 secs ?

Mike C. Fletcher mcfletch at rogers.com
Wed May 19 11:05:59 EDT 2004


Cameron Laird wrote:
...

>>>I would like to make my script to wait 3 seconds ( so I can read the 
>>>output on the console )
>>>and then continue.
>>>How do I do it ?
>>>      
>>>
...

>While time.sleep() certainly is correct at that level,
>I'm concerned about whether it's the best advice we can
>give.  
>
...

I *try* to climb out of the muck and into the promised land ( ;) ) of XP 
and Cameron just pulls me back into the mire!  Certainly, if you need a 
timeout on reading a file (i.e. stdin) then you're going to need more 
code, but he was explicitly looking for a pause to *read* what's on the 
console.

Explaining the use of non-blocking IO and polling loops is rather too 
involved if someone just wants a 3-second pause :) ... or at least it's 
too involved for the amount of time I have to spend on it this week :) 
.  I suppose I could have mentioned the use of raw_input as a first step 
toward interactivity, but then I'd have to do the timeout dance anyway, 
and I'm a fundamentally lazy person when I'm short on time (i.e. always) 
:) .  Cameron, however, will be happy to right this wrong with a solid 
tutorial on the proper path to enlightenment :) ;) .

Have fun,
Mike

________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/
  blog: http://zope.vex.net/~mcfletch/plumbing/





More information about the Python-list mailing list