Skip to content

Instantly share code, notes, and snippets.

@alessandroiori
Created October 2, 2018 15:14
Show Gist options
  • Select an option

  • Save alessandroiori/1c10cc39a7d8083d23336e923f4c124f to your computer and use it in GitHub Desktop.

Select an option

Save alessandroiori/1c10cc39a7d8083d23336e923f4c124f to your computer and use it in GitHub Desktop.
argparse example
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