"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
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
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
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
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
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
>> 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
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
>> >>
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
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
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
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)
$
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
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
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
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
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
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...
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
--
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
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
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
--
http://mail.python.org/mailman/listinfo/python-list
22 matches
Mail list logo