![]() Password_label = Entry(password_gen, bd=0, bg="gray85", textvariable= password_v, state="readonly") #Create a read only entry box to view the output, position using place #Assign the password to the declared string variables Password="Created password: "+str(password) #Since the returned value is a list, we convert to a string using join Password = random.choices(character_string,k=length) Password = random.sample(character_string,length) #Check if user allows repetition of characters Messagebox.showerror(message="Please key in the required inputs") Define password generator function #Password generator function from tkinter import *: To use widgets and define the application interface, we import tkinterĢ.Thus we use messagebox to raise such prompts from tkinter import messagebox: In case the user fails to provide inputs, we must raise a prompt.In our case, it will generate a random string containing characters from the original string. ![]() Random is a built-in module used to generate a random subset or a substring of a list, array or string.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |