#sys.stdin.readlines() can be useful for reading a file that was piped in from the shell like this: # Feed `input_file.txt` to `sys.stdin` of the Python script #python my_script.py < input_file.txt ...