Created
October 2, 2018 15:14
-
-
Save alessandroiori/1c10cc39a7d8083d23336e923f4c124f to your computer and use it in GitHub Desktop.
argparse example
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
| from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter | |
| ''' | |
| $ python3 test_argparse.py -h | |
| ''' | |
| if __name__ == '__main__': | |
| parser = ArgumentParser('TestARGPARSE', description='Easy script for testing ARGPARSE', | |
| formatter_class=ArgumentDefaultsHelpFormatter) | |
| parser.add_argument('-i', '--interface', default='wlan1', required=False, help='Interface to used') | |
| parser.add_argument('-c', '--count', default='0', required=False, help='Max sniff number') | |
| parser.add_argument('-t', '--timeout', default=None, required=False, help='Max sniff time') | |
| args = parser.parse_args() | |
| print(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment