Time delay loop - better way?

Conrad bogus_address at nospam.com
Wed Jun 30 18:48:43 EDT 2004


Greetings,

Q: Is there some way to gracefully suspend a python app for a second or
   so then resume? I could write the classic basic dumb
   loop-tenzillion-times delay, but that seems inelegant, and well, just
   wrong. By the way, I'm also using wxPython, if that helps any.

I need to delay a python program for about a second. Googling around, it
looks like most of the timer stuff has to do with thread handling, but my
application is not threaded, just a small app that has problems printing
to a serial label printer if there's not some delay between labels. The
best solution would be if the freakin printer worked right, but I've tried
all the possible flow control settings in pyserial and the windows
com port, and apparently there just has to be some magic undocumented
delay between labels, or they get screwed up.

Not a huge crisis, I admit, as I can work around with a dumb loop, but
again - I know there's a more correct way to do this.

Thanks,

Conrad





More information about the Python-list mailing list