The following code works great for Python 3. It immediately outputs the user input to the console
import sys
for line in sys.stdin:
print (line)
Unfortunately, it doesn't seem to work for Python 2.7 and 2.6 (yes, i do change the print command) - it just wouldn't output my lines
Am i making some stupid mistake, or is there another way to make it work for lower versions of Python?