1import string
2from random import *
3characters = string.ascii_letters + string.punctuation + string.digits
4password = "".join(choice(characters) for x in range(randint(8, 16)))
5print password
6
1import random
2chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@£$%^&*().,?0123456789'
3
4number = input('Please enter a number of passwords.')
5try:
6 number = int(number)
7except:
8 print("Error, please enter a number!")
9
10length = input('Length of password?')
11try:
12 length = int(length)
13except:
14 print("Error, please enter a number!")
15
16print('\nHere are your password(s):')
17
18for pwd in range(number):
19 password = ''
20 for c in range(length):
21 password += random.choice(chars)
22 print(password)
1import random
2
3alph = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ\
4 abcdefghijklmnopqrstuvwxyz\
5 1234567890 !@#$%^&*(){}[]<>,.')
6out = ''
7for char in string:
8 out += random.choice(alph)
9
10print(out)
1from tkinter import *
2from random import randint
3
4root = Tk()
5root.title('Codemy.com - Strong Password Generator')
6root.iconbitmap('c:/gui/codemy.ico')
7root.geometry("500x300")
8
9
10# Generate Random Strong Password
11def new_rand():
12 # Clear Our Entry Box
13 pw_entry.delete(0, END)
14
15 # Get PW Length and convert to integer
16 pw_length = int(my_entry.get())
17
18 # create a variable to hold our password
19 my_password = ''
20
21 # Loop through password length
22 for x in range(pw_length):
23 my_password += chr(randint(33,126))
24
25 # Output password to the screen
26 pw_entry.insert(0, my_password)
27
28
29# Copy to clipboard
30def clipper():
31 # Clear the clipboard
32 root.clipboard_clear()
33 # Copy to clipboard
34 root.clipboard_append(pw_entry.get())
35
36# Label Frame
37lf = LabelFrame(root, text="How Many Characters?")
38lf.pack(pady=20)
39
40# Create Entry Box To Designate Number of Characters
41my_entry = Entry(lf, font=("Helvetica", 24))
42my_entry.pack(pady=20, padx=20)
43
44# Create Entry Box For Our Returned Password
45pw_entry = Entry(root, text='', font=("Helvetica", 24), bd=0, bg="systembuttonface")
46pw_entry.pack(pady=20)
47
48# Create a frame for our Buttons
49my_frame = Frame(root)
50my_frame.pack(pady=20)
51
52# Create our Buttons
53my_button = Button(my_frame, text="Generate Strong Password", command=new_rand)
54my_button.grid(row=0, column=0, padx=10)
55
56clip_button = Button(my_frame, text="Copy To Clipboad", command=clipper)
57clip_button.grid(row=0, column=1, padx=10)
58
59root.mainloop()
60
61
1import random
2import string
3
4x = str(input("Do you want a password? y/n "))
5
6list = []
7if x == "y":
8 print("Alright!")
9 for i in range(16):
10 _1 = random.choice(string.ascii_letters)
11 _2 = random.randint(1, 9)
12 list.append(_1)
13 list.append(_2)
14else:
15 print("ok")
16
17
18def convert(list):
19
20 s = [str(i) for i in list]
21
22 res = "".join(s)
23
24 return(print(res))
25
26
27
28convert(list)
29
30
1#Simple Way To Make Password Generator
2#NickSiteCoder
3import random
4
5characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@€$#%({)}],/<\.>[*^&"
6
7while 1:
8 length = int(input("What length would you like your password to be ? :"))
9 count = int(input("How many passwords would you like ? "))
10 for x in range(0, count):
11 password = ""
12 for x in range(0,password_len):
13 password_characters = random.choice(characters)
14 password = password + password_characters
15 print("Here is your password : ",password)