read from standard input

Siva B sivaits4u at gmail.com
Sat Dec 5 04:20:12 EST 2009


for the line of code you given,

print type(sys.stdin), sys.stdin

the output is:
<class 'idlelib.rpc.RPCProxy'> <idlelib.rpc.RPCProxy object at 0x00BE8090>

there is no change.
I have tried it in  python2.6 on windows platform.

Thanks,
Siva


On Sat, Dec 5, 2009 at 12:57 PM, Chris Rebert <clp2 at rebertia.com> wrote:

> > On Sat, Dec 5, 2009 at 11:54 AM, Chris Rebert <clp2 at rebertia.com> wrote:
> >>
> >> On Fri, Dec 4, 2009 at 9:37 PM, Siva B <sivaits4u at gmail.com> wrote:
> >> > Hi all,
> >> >
> >> > I wrote a program to read some data through standard input and write
> in
> >> > a
> >> > file.
> >> > the following code works fine in linux.
> >> > but its giving ArgumentError in windows.
> >>
> >> There's no such error in Python; you're thinking of Ruby.
> >> Unless you give the /actual/ error (with message) and full traceback,
> >> there's not much we can do to help you besides just guess.
> >>
> >> <snip>
> >> > file=open('data.txt','w')
> >>
> >> Don't use `file` as a variable name, you're shadowing the built-in type.
> >>
> >> > and what is the command in windows for EOF (like Cntrl D in linux)
> >>
> >> http://tinyurl.com/yggsby3
> >> The *very first result* has the answer in its 6th sentence.
>
> On Fri, Dec 4, 2009 at 11:13 PM, Siva B <sivaits4u at gmail.com> wrote:
> > Hi Chris,
> > Thanks for you reply.
> > The error log is here for my above program in windows:
> >
> > Traceback (most recent call last):
> >   File "C:\Documents and Settings\user\Desktop\t1.py", line 3, in
> <module>
> >     orig_source = sys.stdin.read()
> > AttributeError: read
>
> Okay, that Shouldn't Be Happening (tm). Add the following before line
> 3 and post the output:
>
> print type(sys.stdin), sys.stdin
>
> And while we're at it, what version of Python are your running?
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091205/b5b6487b/attachment-0001.html>


More information about the Python-list mailing list