$ python egg.py -i some-list.list
$ cat some-list.list | python egg.py
$ python egg.py < some-list.list
The one that automatically switches between these things.
#!/usr/bin/env python3
# coding: utf-8
import argparse
import sys
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-i', '--inline', type=argparse.FileType('r'), default=sys.stdin, help='some list')
if __name__ == '__main__':
args = parser.parse_args(args=sys.argv[1:])
print(args.inline.read())
If there are both, I think -i will take precedence.