Feb-07-2022, 06:43 PM
You can also use functools partial to pas variables.
import tkinter as tk from tkinter.ttk import * from functools import partial window = tk.Tk() def Adder(): AddingWindow = tk.Toplevel(window) AddingWindow.geometry("400x400") Label(AddingWindow, text="Mail/Username", width="20", font="Calibri 22 bold").pack() name = Entry(AddingWindow, width=50) name.pack() Label(AddingWindow, text="Password", width="20", font="Calibri 22 bold").pack() passw = Entry(AddingWindow, width=50) passw.pack() Add = Button(AddingWindow, text="Add", width="20") Add.config (command = partial(Save, passw)) Add.pack () def Save(Password): print(Password.get()) window.geometry("500x500") greeting = tk.Label(text="Password Manager: Developed by KEIKAS", font="Calibri 20 bold") AddB = tk.Button(text="Add", width="20",height="2",bg="green", command=Adder) AccessB = tk.Button(text="Access", width="20",height="2",bg="blue") RemoveB = tk.Button(text="Remove", width="20",height="2",bg="red") greeting.pack() AddB.pack() RemoveB.pack() AccessB.pack() window.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags