Skip to content

Instantly share code, notes, and snippets.

@nuald nuald/pwd.py
Created Jul 2, 2016

Embed
What would you like to do?
Simple password generator
#!/usr/bin/env python3
""" Simple password generator """
import random
import argparse
def main():
""" Main entry """
parser = argparse.ArgumentParser()
parser.add_argument(
'-l', '--length', dest='length', type=int, default=8,
help='Length of the generated password'
)
args = parser.parse_args()
print(
''.join([chr(random.randrange(32, 126)) for __ in range(args.length)])
)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.