I am trying to get input from the user at the command prompt. The program reads in data from a text file in the manner of \"cat text.txt | ./thescript.py\"
At the
This works under windows (I tested it by running python cons.py < cons.py and was able to see the prompt and not get an error about EOF):
import sys
for line in sys.stdin:
print line
sys.stdin = open('CON', 'r')
q = raw_input('---->')
Under Unix, you'd probably just have to replace 'CON' with something in the /dev dir.