Re: Is there a simple way to exit a while loop on keystroke?

2007-09-01 Thread Hendrik van Rooyen
gsxg [EMAIL PROTECTED] wrote: I am new to python, and have written a simple program to read a port via telnet. I would like it to run until any key is pressed. Of course I wouldn't mind requiring a specific keystroke in the future, but I would think this is simpler for now. I have used

Re: Is there a simple way to exit a while loop on keystroke?

2007-09-01 Thread Arnaud Delobelle
On Aug 31, 10:28 pm, [EMAIL PROTECTED] wrote: On Aug 31, 3:55 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Aug 31, 7:11 pm, gsxg [EMAIL PROTECTED] wrote: Thanks, The curses library doesn't look to helpful to me. And yet it is. -- Arnaud Maybe the OP is on Windows. The docs

Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread gsxg
I am new to python, and have written a simple program to read a port via telnet. I would like it to run until any key is pressed. Of course I wouldn't mind requiring a specific keystroke in the future, but I would think this is simpler for now. I have used kbhit() and getch() many times in C,

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread Miki
Hello, I am new to python, and have written a simple program to read a port via telnet. I would like it to run until any key is pressed. Of course I wouldn't mind requiring a specific keystroke in the future, but I would think this is simpler for now. I have used kbhit() and getch() many

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread gsxg
Thanks, The curses library doesn't look to helpful to me. However using CTRL- C is fine and is working nicely. BTW, it should be time.sleep(1) in the example above, instead of just sleep(1) (Just in case any other newbies like me read this) Thanks again --

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread Arnaud Delobelle
On Aug 31, 7:11 pm, gsxg [EMAIL PROTECTED] wrote: Thanks, The curses library doesn't look to helpful to me. And yet it is. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread half . italian
On Aug 31, 11:11 am, gsxg [EMAIL PROTECTED] wrote: Thanks, The curses library doesn't look to helpful to me. However using CTRL- C is fine and is working nicely. BTW, it should be time.sleep(1) in the example above, instead of just sleep(1) (Just in case any other newbies like me read

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread kyosohma
On Aug 31, 3:55 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Aug 31, 7:11 pm, gsxg [EMAIL PROTECTED] wrote: Thanks, The curses library doesn't look to helpful to me. And yet it is. -- Arnaud Maybe the OP is on Windows. The docs seem to indicate that the curses module isn't for

Re: Is there a simple way to exit a while loop on keystroke?

2007-08-31 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], gsxg wrote: I am new to python, and have written a simple program to read a port via telnet. I would like it to run until any key is pressed. Did you mean telnet or did you mean local terminal? For a local terminal, the following demo script should give you a