ETA: based on your comment that you work in an infinite loop, you probably just don't have an empty line at the end of the file.
Use pipe symbol:
input.input | python graph.py
If input.input is actually a file, not a stream, use cat to create a stream from it:
cat input.input | python graph.py
source share