I\'ve encountered an extremely confusing problem. Whatever I type into the Python interpreter returns \"Invalid Syntax\". See examples below. I\'ve tried fooling around w
Now that the sample has been cleaned up it appears the problem is with the line termination.
This isn't a solution, but what happens if you create a file t.py containing this code, run it, and then type in some text?:
import sys; print(repr(sys.stdin.readline()))
If you type something like 2+2 then with luck this will show you what the Python interpreter is getting in your example and that in turn might give some clue to the problem.
You can also try this at the command prompt:
python -c "import sys; print(repr(sys.stdin.readline()))"
This will allow you to type one line and display the details of that one line.