Skip to content

Instantly share code, notes, and snippets.

@nuald nuald/
Created Jul 2, 2016

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()
'-l', '--length', dest='length', type=int, default=8,
help='Length of the generated password'
args = parser.parse_args()
''.join([chr(random.randrange(32, 126)) for __ in range(args.length)])
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.