Talk:Python Programming/Input and Output

A very reasonable code on this page:

import sys for line in sys.stdin: print line,

but here is what I am getting back:

for line in sys.stdin : IOError: [Errno 9] Bad file descriptor

?????

Problem?
Is this guide out of date or something, cause when I put in "print raw_input 'What is your name?'" in my Python3.0 command line, it returns a syntax error.
 * Yes, somewhat. It has a note saying that in Python 3.x, you need to use "input" instead of "raw_input". I'm having a problem with EOFError instead of syntax error. It mentions that it happens if it terminates prematurely, but I don't know how to not make it end prematurely? 194.82.177.16 (discuss) 09:38, 17 October 2011 (UTC)