#!/usr/bin/python
# password generator, version 2 # Randy Gamage # Takes length as an input (8-32 chars) and returns a password # containing upper/lower/numbers, but no special chars import string, random def MakeRanPwd(pwdlen): validset = string.ascii_letters + string.digits pwd = '' for i in range(pwdlen): pwd += validset[random.randint(0,len(validset)-1)] return pwd pwdlen = int(raw_input("Enter desired length (8-32 chars):")) print MakeRanPwd(pwdlen)