Your script works, it just seems your expectations are not correct.
script.py (adjusted for Python 3, which is what I have installed):
import sys
for line in sys.stdin:
print(line)
$ python script.py
abcd
abcd
xyz
xyz
Where the first occurrences of "abcd" and "xyz" were my inputs from the keyboard and the second ones were the program's outputs. I terminated execution at that point via ctrl-d.
The issue is that reading from stdin without input from a pipe isn't giving you what you expect. When you just run the script (without piped input), it just sits there waiting for you to enter something from the keyboard. You may want to investigate raw_input for taking input from the keyboard.
Update:
After getting more clarification in comments about what you want, the following script may give you the results you desire:
import sys
if not sys.stdin.isatty():
for line in sys.stdin:
print(line)
print("More stuff!")