Is there a simple way to exit a while loop on keystroke?
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, but I can't find
anything similar in Python. I am using Linux also, so the msvcrt
code isn't an option. I have tried sys.stdin.read(), but that hangs
UNTIL a key is pressed.
Thanks
.
Relevant Pages
- Re: History of SSG and Symstream on 2200?
... advantages of Python. ... With the posting of the Windows port of SSG, I had thought it might be ... or indeed any other such scripting language ... So there is a "paradigm mismatch" between SSG and most modern scripting ... (comp.sys.unisys) - Re: Newbie advice
... which started as a port of the Google Web ... taking Python code and compiling it into javascript. ... pyjamas-desktop was merged into pyjamas as of the 0.6 release. ... of the webkit developer, mark rowe. ... (comp.lang.python) - Req. for module style/organization
... I've begun a Python module to provide a complete interface to the Meade LX200 command set, and have searched for a style/development guide for Python Lib/site-packages type modules, but only saw guides for C-modules. ... There is a second com port available for optional separate control, ... (comp.lang.python) - Re: Standalone USB Web Server and Python Interpeter
... I would envisage a batch file which would ask if the USB web server ... I need v2.3 python. ... This is a simple HTTP server that can call external scripts through the ... PORT = 8000 ... (comp.lang.python) - Re: Experiencing blank @pkgdep entries
... the instructions in UPDATING for portmaster: ... The default version of Python has been changed from 2.5.x to 2.6.x. ... libtool/libtldl upgrade before python's? ... and they were one-off's (i.e. one port affected only). ... (freebsd-questions) |
|