I am trying to open a second window and then run some code and close the second window on the button event. I have tried every example that I can find and I still get an attribute error. I am pretty new to this.
I stripped out most of the code so that it's easier to read.
# ADD NEW PASSWORD
def add_pass():
add_pass = Toplevel()
add_pass.title("Enter New Password")
add_pass.geometry('500x700')
# add_pass.resizable(0, 0)
Add_Button = Button(add_pass, text="Enter", font=("normal", 14),
command=add_butt)
Add_Button.grid(row=12, column=2, pady=30)
def add_butt():
print(Person_Entry.get())
# Create a database or connect to one
conn = sqlite3.connect('Pass.db')
c = conn.cursor()
# WRITE TEXT BOXES TO SQLITE3 DB USING VARIABLES.
PassData = [(Seq_Entry.get(), Person_Entry.get(), Name_Entry.get(),
URL_Entry.get(), Username_Entry.get(), Password_Entry.get(), Hint1_Entry.get(),
Hint2_Entry.get(), Hint3_Entry.get(), Notes_Entry.get())]
for element in PassData:
c.execute("INSERT INTO Passwords VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
element)
# Commit Changes
conn.commit()
# Close Connection
conn.close()
add_pass.destroy()
root = Tk()
root.geometry('500x500')
root.title('Password Saver')
my_menu = Menu(root)
root.mainloop()