Skip to content

Instantly share code, notes, and snippets.

Last active Dec 16, 2015
What would you like to do?
import random
import argparse
parser = argparse.ArgumentParser(description='Generate random characters from specified length/lines.')
parser.add_argument('length', help='length of line', type=int )
parser.add_argument('number', help='number of lines', type=int )
args = parser.parse_args()
passlen = args.length
count = args.number
s = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789'
for i in range(count):
password = ''
for j in range(passlen):
password += random.choice(s)
print password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment