Advertisement
182days

Password Generator (Write to File)

May 10th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. #generates 1000 random 10 digit number passwords and writes to a file
  2. import random
  3. counter=0
  4. print("please wait...")
  5. while True:
  6.     randnum = random.randint(1000000000, 9999999999)
  7.     myobj=open("passwords.txt", "a")
  8.     myobj.write(str(randnum) + "\n")
  9.     myobj.close()
  10.     counter=counter+1
  11.     if counter == 1000:
  12.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement