<filename>Projects/Random Password Generator/main.py
import random, string
from tkinter import *
import pyperclip
 
 
#Initialize Window
 
root =Tk()
root.geometry("1920x1080") #size of the window by default
 
#title of our window
root.title("Random Password Generator")
 
# -------------------  Random Password generator function
 
output_pass = StringVar()
 
all_combi = [string.punctuation, string.ascii_uppercase, string.digits, string.ascii_lowercase]  #list of all possible characters
 
def randPassGen():
    password = "" # to store password
    for y in range(pass_len.get()):
        char_type = random.choice(all_combi)   #to randomize the occurance of alphabet, digit or symbol
        password = password + random.choice(char_type)
     
    output_pass.set(password)
 
# ----------- Copy to clipboard function
 
def copyPass():
    pyperclip.copy(output_pass.get())
 
#-----------------------Front-end Designing (GUI)
 
pass_head = Label(root, text = 'Password Length', font = 'arial 12 bold').pack(pady=10) #to generate label heading
 
pass_len = IntVar() #integer variable to store the input of length of the password wanted
length = Spinbox(root, from_ = 4, to_ = 32 , textvariable = pass_len , width = 100, font='arial 16').pack()
 
#Generate password button
 
Button(root, command = randPassGen, text = "Generate Password", font="Arial 10", bg='lightblue', fg='black', activebackground="teal", padx=5, pady=5 ).pack(pady= 20)
 
pass_label = Label(root, text = 'Random Generated Password', font = 'arial 12 bold').pack(pady="30 10")
Entry(root , textvariable = output_pass, width = 100, font='arial 16').pack()
 
#Copy to clipboard button
 
Button(root, text = 'Copy to Clipboard', command = copyPass, font="Arial 10", bg='lightblue', fg='black', activebackground="teal", padx=5, pady=5 ).pack(pady= 20)
 
root.mainloop()  #to bundle pack the code for tkinter
<filename>Projects/Random Password Generator/main.py
import random, string
from tkinter import *
import pyperclip
 
 
#Initialize Window
 
root =Tk()
root.geometry("1920x1080") #size of the window by default
 
#title of our window
root.title("Random Password Generator")
 
# -------------------  Random Password generator function
 
output_pass = StringVar()
 
all_combi = [string.punctuation, string.ascii_uppercase, string.digits, string.ascii_lowercase]  #list of all possible characters
 
def randPassGen():
    password = "" # to store password
    for y in range(pass_len.get()):
        char_type = random.choice(all_combi)   #to randomize the occurance of alphabet, digit or symbol
        password = password + random.choice(char_type)
     
    output_pass.set(password)
 
# ----------- Copy to clipboard function
 
def copyPass():
    pyperclip.copy(output_pass.get())
 
#-----------------------Front-end Designing (GUI)
 
pass_head = Label(root, text = 'Password Length', font = 'arial 12 bold').pack(pady=10) #to generate label heading
 
pass_len = IntVar() #integer variable to store the input of length of the password wanted
length = Spinbox(root, from_ = 4, to_ = 32 , textvariable = pass_len , width = 100, font='arial 16').pack()
 
#Generate password button
 
Button(root, command = randPassGen, text = "Generate Password", font="Arial 10", bg='lightblue', fg='black', activebackground="teal", padx=5, pady=5 ).pack(pady= 20)
 
pass_label = Label(root, text = 'Random Generated Password', font = 'arial 12 bold').pack(pady="30 10")
Entry(root , textvariable = output_pass, width = 100, font='arial 16').pack()
 
#Copy to clipboard button
 
Button(root, text = 'Copy to Clipboard', command = copyPass, font="Arial 10", bg='lightblue', fg='black', activebackground="teal", padx=5, pady=5 ).pack(pady= 20)
 
root.mainloop()  #to bundle pack the code for tkinter
#Initialize Window #size of the window by default #title of our window # -------------------  Random Password generator function #list of all possible characters # to store password #to randomize the occurance of alphabet, digit or symbol # ----------- Copy to clipboard function #-----------------------Front-end Designing (GUI) #to generate label heading #integer variable to store the input of length of the password wanted #Generate password button #Copy to clipboard button #to bundle pack the code for tkinter