Last active
January 23, 2020 18:39
-
-
Save crosenth/c6f374799b0e2626ee9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import sys | |
| def get_args(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('arg1') | |
| parser.add_argument('--option1') | |
| parser.add_argument( | |
| '--out', type=argparse.FileType('w'), default=sys.stdout) | |
| return parser.parse_args() | |
| def main(): | |
| args = get_args() | |
| print(args) | |
| if __name__ == '__main__': | |
| sys.exit(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment