read sys.stdin, then raw_input

  • Thread starter Rory Campbell-Lange
  • Start date
R

Rory Campbell-Lange

I'm stumped. I'm piping some content to a python program, but then want
the python program to prompt me for an answer. It goes on reading
the pipe and gives a "EOFError: EOF when reading a line".

eg:
#!/usr/bin/python

import sys
text = sys.stdin.read()
sel = raw_input('Selection? : ')

Selection? : Traceback (most recent call last):
File "/tmp/z.py", line 5, in ?
sel = raw_input('Selection? : ')
EOFError: EOF when reading a line

Advice much appreciated.

Rory
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top