![]() Label_password_length = ttk.Label(self, text="Length") Ttk.Radiobutton(complexity_panel, text=label, variable=plexity_value, value=index)įor (index, label) in enumerate(complexity_options) Generate = ttk.Button(action_panel, text="Generate", command=self.generate)Ĭomplexity_options = ("Low", "Medium", "Strong") Password_value = ttk.Entry(self, state='readonly', textvariable=self.password)Ĭopy = ttk.Button(action_panel, text="Copy", command=py_to_clipboard) Label_password = ttk.Label(self, text="Password") Here's a solution keeping some of the structure you already have: import random There are clipboard functions in Tk that doesn't require you to use another module like pyperclip.Using buttons to make Frames appears and disappear looks a lot like how the Notebook widget is working.You should use things that already exists before trying to reinvent the wheel. I would recommend that you look at the TkDocs for an introduction on how to create GUI using tkinter. This not a secret that there is not a lot of documentation on Tk. P3.place(in_=container, x=0, y=0, relwidth=1, relheight=1) P2.place(in_=container, x=0, y=0, relwidth=1, relheight=1) P1.place(in_=container, x=0, y=0, relwidth=1, relheight=1) Tabsframe.pack(side="top", fill="x", expand=False)Ĭontainer.pack(side="top", fill="both", expand=True)ī1 = tk.Button(tabsframe, text="Generate Password", command=p1.lift)ī2 = tk.Button(tabsframe, text="Add Profile", command=p2.lift)ī3 = tk.Button(tabsframe, text="View Profiles", command=p3.lift) Label = tk.Label(self, text="This is page 3") Label.pack(side="bottom", fill="both", expand=True) Label = tk.Label(self, text="This is page 2") Radio_strong = Radiobutton(root, text="Strong", variable=diff, value=3) Radio_middle = Radiobutton(root, text="Medium", variable=diff, value=2) Radio_low.grid(row=2, column=2, sticky='E') Radio_low = Radiobutton(root, text="Low", variable=diff, value=1) Generate_button = Button(root, text="Generate", command=generate) Random_password = Label(root, text="Password")Ĭopy_button = Button(root, text="Copy", command=copy) # Function for copying password to clipboard Can someone help me out please? This is my code: from tkinter import * I tried making each page a class inside a frame and showing with tk.lift but it doesn't work. will generate a password, page to will allow you to add a profile, and page 3 will let you view all your profiles. I am making a password generator program with multiple pages that each have a different purpose.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |