read from standard input

Chris Rebert clp2 at rebertia.com
Sat Dec 5 01:24:29 EST 2009


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.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list