Advertisement
Guest User

Untitled

a guest
Feb 12th, 2012
1,520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. from random import randint
  2.  
  3. pass_length = 0
  4. amount_to_gen = 0
  5.  
  6. amount_to_gen = int(raw_input("How many passwords do you want to generate?"))
  7. pass_length = int(raw_input("How long do you want your password(s)?"))
  8.  
  9. txt = open('passwords.txt', 'a')
  10.  
  11. j = 0
  12. while j < amount_to_gen:
  13.     i = 0
  14.     temp_pass = ''
  15.     while i < pass_length:
  16.         temp_pass += chr(randint(33, 125))
  17.         i += 1
  18.     txt.write(temp_pass + '\n')
  19.     j += 1
  20. txt.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement