how to take standard input in python code example
Example 1: python read from stdin
import sys
data = sys.stdin.readlines()
Example 2: python read from stdin pipe
k = 0
try:
while True:
print sys.stdin.readline()
k += 1
except KeyboardInterrupt:
sys.stdout.flush()
pass
print k