Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
For CLI tutorial
import argparse
welcome = "Practicing creating interactive command-line interfaces"
parser = argparse.ArgumentParser(description=welcome)
parser.add_argument('--domain', '-d', required=True,
help='domain name of the website you want to scrape. i.e. ""')
parser.add_argument('--ofile', '-o',
help='define output file to save results of stdout. i.e. "output.txt"')
parser.add_argument('--lines', '-l',
help='number of lines of output to print to the console"', type=int)
args = parser.parse_args()
domain = args.domain
ofile = args.ofile
lines = args.lines
print("domain:", domain)
print("output file:", ofile)
print("lines:", lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment