I am trying to read the content of a text file that was redirected stdin via the command line, and send it by the Internet when the receiver has to assemble it back to it\'s
Instead of breaking, you just want to continue to the next line. The iterator will stop automatically when it reaches the end of the file.
continue
import sys result = "" for line in sys.stdin: stripped = line.strip() if not stripped: continue result += stripped