Re: stopping a while True: with the keyboard

2007-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, patrick wrote: > i am looking for a way to break a while True: when pressing "s" on my > keyboard. how can i do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: stopping a while True: with the keyboard

2007-09-25 Thread Gabriel Genellina
En Tue, 25 Sep 2007 22:19:08 -0300, patrick <[EMAIL PROTECTED]> escribi�: > i am looking for a way to break a while True: when pressing "s" on my > keyboard. how can i do this? Windows only: Using the msvcrt module: from msvcrt import kbhit, getch a, b = 1, 1 while True: a, b = a+b

Re: stopping a while True: with the keyboard

2007-09-25 Thread Ben Finney
Benjamin <[EMAIL PROTECTED]> writes: > On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > > hi all, > > > > i am looking for a way to break a while True: when pressing "s" on my > > keyboard. how can i do this? > > > > pat > > Ctrl-C That's not a very helpful response, since it doesn't add

Re: stopping a while True: with the keyboard

2007-09-25 Thread Andy
Hi, I think you can use the 'curses' module to catch the keyboard event. The name of the method is 'keyname()'. But I'm afraid curses is not available on Windows Python, so you may have to be a bit more imaginative. I just tried with Python 2.4 on Windows XP. To leave the while loop, use the 'b

Re: stopping a while True: with the keyboard

2007-09-25 Thread patrick
i don't want to quit my program only get out from a while True: also i want to use only 1 key like s. pat Benjamin wrote: > On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > >> hi all, >> >> i am looking for a way to break a while True: when pressing "s" on my >> keyboard. how can i d

Re: stopping a while True: with the keyboard

2007-09-25 Thread Benjamin
On Sep 25, 8:19 pm, patrick <[EMAIL PROTECTED]> wrote: > hi all, > > i am looking for a way to break a while True: when pressing "s" on my > keyboard. how can i do this? > > pat Ctrl-C -- http://mail.python.org/mailman/listinfo/python-list

stopping a while True: with the keyboard

2007-09-25 Thread patrick
hi all, i am looking for a way to break a while True: when pressing "s" on my keyboard. how can i do this? pat -- http://mail.python.org/mailman/listinfo/python-list