Re: sys.stdin.read question

2004-12-08 Thread Caleb Hattingh
I don't have much experience with popen3. I do know that IDLE (interactive interpreter) does something to sys.stdin, and that is probably the problem you are seeing. Try your commands through the python interactive interpreter started from a shell (DOS or Bash), see if it still happens.

Re: sys.stdin.read question

2004-12-07 Thread It's me
Yes, if I run the script from the command prompt, it works. I was running it inside the Python IDE. Thanks, -- It's me "Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote: > > >> Dunno. Works fine for me under 2.3.4, a

Re: sys.stdin.read question

2004-12-07 Thread Lars Tengnagel
Hej Caleb and others I've been strugling with the same problem where i try to use popen3 to run a program. If I use a piped commandline the program can read the file without problems but in the IDLE and with popen it comes with an error. I haven't been able to read the stdin either so the proble

Re: sys.stdin.read question

2004-12-07 Thread Grant Edwards
On 2004-12-08, Caleb Hattingh <[EMAIL PROTECTED]> wrote: > It runs properly in a shell (bash), but on another matter: > > '>>> r=sys.stdin.read(1) > g > '>>> r > 'g' > '>>> r=sys.stdin.read(5) > 1234567890 > '>>> r > '\n1234' > '>>> > > What exactly happened to my 1234567890? I understand that I

Re: sys.stdin.read question

2004-12-07 Thread Grant Edwards
On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote: >> Dunno. Works fine for me under 2.3.4, and according to the >> docs, should work under 2.4. >> >> What do you get when you do this: >> >> import sys > > Done that. > >> type(sys.stdin) > > I get: > > > >> dir(sys.stdin) > > I get: > > ['_

Re: sys.stdin.read question

2004-12-07 Thread It's me
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote: > > Why do I get an "AttributeError: read" message when I do: > > > > import sys > > r=sys.stdin.read() > > Dunno. Works fine for me under 2.3.4, and according to

Re: sys.stdin.read question

2004-12-07 Thread Caleb Hattingh
It runs properly in a shell (bash), but on another matter: '>>> r=sys.stdin.read(1) g '>>> r 'g' '>>> r=sys.stdin.read(5) 1234567890 '>>> r '\n1234' '>>> What exactly happened to my 1234567890? I understand that I am only taking 5 characters, but where does the newline (\n) come from? Is that a

Re: sys.stdin.read question

2004-12-07 Thread Caleb Hattingh
Hi You are probably typing this within IDLE. Try it after starting python in a shell like DOS or Bash. Should work then (works for me, and I also get the AttributeError in IDLE. Thanks Caleb On Tue, 07 Dec 2004 21:15:51 GMT, It's me <[EMAIL PROTECTED]> wrote: Why do I get an "AttributeError:

Re: sys.stdin.read question

2004-12-07 Thread Grant Edwards
On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote: > Why do I get an "AttributeError: read" message when I do: > > import sys > r=sys.stdin.read() Dunno. Works fine for me under 2.3.4, and according to the docs, should work under 2.4. What do you get when you do this: import sys type(sy