sysUse the module
import sys
for line in sys.stdin:
print line
If you want to get the file name as command line argument and read the file, We recommend the fileinput module. If you're given a file name, read it to me If you're not given anything, read it on stdin.
import fileinput
for line in fileinput.input():
pass
© 2024 OneMinuteCode. All rights reserved.