loop until keypress (Windows XP)

Thomas Guettler niemand.leermann at thomas-guettler.de
Thu Aug 10 04:04:38 EDT 2006


Am Wed, 09 Aug 2006 22:19:24 -0700 schrieb placid:

> Hi all,
> 
> 
> Im using the cmd module and i have command that loops and keeps on
> printing text, what i want to be able to do is loop until the user
> presses a particular key, say Q/q ? I tried the following code;
> 

There is a portable getch() implementation:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892

It does not loop, it waits until the key is pressed. I hope that is what
you want.



More information about the Python-list mailing list