I wanna replace the widgets in the tkinter gui, but when i am using .destroy, i am getting the object nonetype has no attribute destroy, I am not able to use for loop to use .win_children and then for child in children, I need help.
import tkinter as tk
import smtplib
win = tk.Tk()
win.title("Email Automater")
win.geometry('400x200')
def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('[email protected]', '*********')
server.sendmail('[email protected]', to, content)
server.close()
def mailGui():
tk.Label(win, text="Message:").place(x=20, y=20)
msg = tk.Entry(win, width=250).place(x=230, y=50)
tk.Label(win, text="To:").place(x=20, y=20)
to_mail = tk.Entry(win, width=25).place(x=20, y=50)
tk.Label(win, text="From:").place(x=230, y=20)
from_mail = tk.Entry(win, width=25).place(x=230, y=50)
tk.Label(win, text="From Password:").place(x=230, y=80)
from_mail = tk.Entry(win, show='*', width=25).place(x=230, y=110)
tk.Button(win, text="Done!", command=mailGui).place(x=230, y=150)
win.mainloop()
This is the code.
Source: Python Questions