how to read a file from stdin in python and stdout code example Example: input stdin python import sys data = sys.stdin.readline() sys.stdout.write('Dive in')