"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > >> 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. > > in the same same sentence, the OP also said that he wanted something like > C's getchar(). if you guys are going to read only parts of the original post, > you could at least try to read an entire sentence, before you start arguing...
Not even sure what's there to argue about - getchar() does do single character input, so the OPs (full) original sentence seems plausible to me, and his example was using it in a while loop which I took to represent processing some input one character at a time. In any event - I also gave a way (Windows-specific) to truly obtain the single next character without any buffering, so just ignore any controversy in the first part of the response if desired. -- David -- http://mail.python.org/mailman/listinfo/python-list