Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def makeRandomPasswordGayan():
- filePath = pickAFile()
- password = ""
- numChars = requestInteger("Enter length of password")
- numPasswords = requestInteger("Enter amount of passwords")
- myList = [None]*numPasswords
- index1 = 0
- while (index1 < numPasswords):
- index2 = 0
- while ( index2 < numChars ):
- typeOfChar = random.randint(0,2)
- if typeOfChar == 0:
- password = password + str(random.randint(0,9))
- elif typeOfChar == 1:
- password = password + chr(random.randint(65,90))
- else:
- password = password + chr(random.randint(97,122))
- index2 = index2+1
- index1 = index1+1
- myFile = open(filePath,"w")
- myFile.write(str(password))
- myFile.close()
- print password
- print myList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement