#!/usr/bin/python import sys line = sys.stdin.readline() while line: line = line.rstrip() print "read from stdin: ", line line = sys.stdin.readline()