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