Re: A completely silly question

2004-12-20 Thread David Bolen
"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 ap

Re: A completely silly question

2004-12-19 Thread Keith Dart
Jp Calderone wrote: On Sun, 19 Dec 2004 23:15:40 GMT, Keith Dart <[EMAIL PROTECTED]> wrote: Mike Meyer wrote: The termios gives module gives you the tools to manipulate the tty directly, without invoking stty. The tty module gives you an easier interface to those routines. However, it's missing a s

Re: A completely silly question

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 23:15:40 GMT, Keith Dart <[EMAIL PROTECTED]> wrote: >Mike Meyer wrote: > > The termios gives module gives you the tools to manipulate the tty > > directly, without invoking stty. The tty module gives you an easier > > interface to those routines. However, it's missing a setsane

Re: A completely silly question

2004-12-19 Thread Keith Dart
Mike Meyer wrote: Craig Ringer <[EMAIL PROTECTED]> writes: On Sat, 2004-12-18 at 00:40, Amir Dekel wrote: This must be the silliest question ever: What about user input in Python? (like stdin) Where can I find it? I can't find any references to it in the documentation. Under UNIX, I generally eith

Re: A completely silly question

2004-12-19 Thread Mike Meyer
Craig Ringer <[EMAIL PROTECTED]> writes: > On Sat, 2004-12-18 at 00:40, Amir Dekel wrote: >> This must be the silliest question ever: >> >> What about user input in Python? (like stdin) >> Where can I find it? I can't find any references to it in the documentation. > > Under UNIX, I generally eit

Re: A completely silly question

2004-12-18 Thread Craig Ringer
On Sat, 2004-12-18 at 00:40, Amir Dekel wrote: > This must be the silliest question ever: > > What about user input in Python? (like stdin) > Where can I find it? I can't find any references to it in the documentation. Under UNIX, I generally either use curses, or just put the terminal into raw m

Re: A completely silly question

2004-12-17 Thread Fredrik Lundh
>> 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 charact

Re: A completely silly question

2004-12-17 Thread Mike Meyer
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 >> >>

Re: A completely silly question

2004-12-17 Thread David Bolen
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... > > > > sy

Re: A completely silly question

2004-12-17 Thread Amir Dekel
Mike Meyer wrote: Hmm. That tells me he's probably on a Windows box, so my unix solution wouldn't do him much good. Yes, Windows...too bad -- http://mail.python.org/mailman/listinfo/python-list

Re: A completely silly question

2004-12-17 Thread Mike Meyer
Steven Bethard <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> That doesn't do what he wants, because it doesn't return until you hit >> a newline. > Of course if the intent is to have this work with terminal input, then > yes, sys.stdin.read(1) is probably not going to do the right thing... T

Re: A completely silly question

2004-12-17 Thread Steven Bethard
Mike Meyer wrote: That doesn't do what he wants, because it doesn't return until you hit a newline. Are you sure that's not just an artifact of how your terminal buffers data for sys.stdin? $ cat temp.py import sys char = sys.stdin.read(1) while char: print char char = sys.stdin.read(1) $

Re: A completely silly question

2004-12-17 Thread marco
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... Take a look at Alan Gauld's "Learning to Program" (http://www.freenetpages.co.uk/hp/alan.gauld/) in the section "Ev

Re: A completely silly question

2004-12-17 Thread wes weston
Amir Dekel wrote: Harlin Seritt wrote: Simple, Simple, Simple: Var = raw_input("Some prompting text here: ") Frans Englich wrote: > > See sys.stdin > 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

Re: A completely silly question

2004-12-17 Thread Mike Meyer
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

Re: A completely silly question

2004-12-17 Thread Peter Hansen
Amir Dekel wrote: What I need from the program is to wait for a single character input, something like while(getchar()) in C. Try the "msvcrt" module if you are on Windows. If you are not, remember to specify your platform next time you ask a question... All those Python modules don't make much

Re: A completely silly question

2004-12-17 Thread Steven Bethard
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) but if you're having trouble reading the module documentation, maybe you could elaborate on what

Re: A completely silly question

2004-12-17 Thread Amir Dekel
Harlin Seritt wrote: Simple, Simple, Simple: Var = raw_input("Some prompting text here: ") Frans Englich wrote: > > See sys.stdin > 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...

Re: A completely silly question

2004-12-17 Thread Harlin Seritt
Amir Dekel wrote: > This must be the silliest question ever: > > What about user input in Python? (like stdin) > Where can I find it? I can't find any references to it in the > documentation. > > Amir Simple, Simple, Simple: Var = raw_input("Some prompting text here: ") -- Harlin Seritt --

RE: A completely silly question

2004-12-17 Thread Batista, Facundo
Title: RE: A completely silly question [Amir Dekel] #- What about user input in Python? (like stdin) #- Where can I find it? I can't find any references to it in #- the documentation. sys.stdin http://docs.python.org/lib/module-sys.html .   Fa

Re: A completely silly question

2004-12-17 Thread Frans Englich
On Friday 17 December 2004 16:40, Amir Dekel wrote: > This must be the silliest question ever: > > What about user input in Python? (like stdin) > Where can I find it? I can't find any references to it in the > documentation. See sys.stdin Cheers, Frans -- http://mail.python.or