David Bolen <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: > >> Steven Bethard <[EMAIL PROTECTED]> writes: >> >> > Amir Dekel wrote: >> >> What I need from the program is to wait for a single character >> >> input, something like while(getchar()) in C. All those Python >> >> modules don't make much sence to me... >> > >> > sys.stdin.read(1) >> >> That doesn't do what he wants, because it doesn't return until you hit >> a newline. > > Well, but that's true as well for getchar() (at least in many cases of > interactive input and line buffering), so in that respect I do think > it's a fairly direct replacement, depending on how the OP was going to > use getchar() in the application.
The OP said "wait for a single character input". sys.stdin.read(1) waits for a newline. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list