Your code is trying to read from stdin, which means you need to at least pipe
something into the stdin, here I changed your code slightly and named it after script.py:
import sys
for line in sys.stdin.readlines():
print (line,1)
And here is the output in shell:
$printf "hello\nworld\n" | python script.py
('hello\n', 1)
('world\n', 1)
The stdin, stdout, and err are three important concepts in unix in general, i would recommend you to read more about it. Say for example, Hadoop Streaming actually leverage stdin/stdout so you can use any language to write map reduce jobs and easily connect different components together.
Here are a few examples of how to get your code working if you have a file.
$ printf "hello\nworld\n" > text
$ cat text
hello
world
$ cat text | python script.py
('hello\n', 1)
('world\n', 1)
$ python script.py < text
('hello\n', 1)
('world\n', 1)