Reading from stdin (in windows)

D

durumdara

Hi!

I wanna write a file processor in python (Windows XP).
I wanna use pipe, and not parameters.

When I write this:

....
l = []
while 1:
t = sys.stdin.read(1)
if t == '':
break
l.append(t)

t = "".join(l)
....

and use code this:
process.py <test.txt

I got:
"Bad file descriptor"

What I do wrong? I need to call this module in another format?
Or I read in wrong way?

Thanks for your help:
dd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top