python use argparse to pass a filename code example
Example 1: python argparse file argument
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('file', type=argparse.FileType('r'))
args = parser.parse_args()
print(args.file.readlines())
Example 2: use argparse that read in file usernames python script
use argparse that read in file usernames python script