Llevo dos días aprendiendo tkinter y llevo 1h dándole vueltas y no soy capaz de encontrar una solución a este error. El error que tengo es al ejecutar las ultimas líneas de código (los botones):
AttributeError: 'NoneType' object has no attribute 'get'"
import tkinter as tk
def main():
root = tk.Tk()
root.geometry('600x400')
root.config(bg='#AED8EF')
text1 = tk.Text(root, height=1, width=40)
text2 = tk.Text(root, height=1, width=40)
text3 = tk.Text(root, height=1, width=83)
text1.config(state="normal", bg='#09A4BF')
text1.insert(tk.INSERT, "Enter channel name")
text1.config(state="disabled")
text1.grid(row=0,column=0)
text2.config(state="normal", bg='#09A4BF')
text2.insert(tk.INSERT, "Add word to blacklist")
text2.config(state="disabled")
text2.grid(row=1,column=0)
text3.config(state="normal", bg='#09A4BF')
text3.config(font=("Times New Roman", 10, "italic"))
text3.insert(tk.INSERT, "test")
text3.config(state="disabled")
text3.place(x=5,y=350)
def button_command():
with open('black_list.txt', 'a') as black_list:
black_list.write(entry1.get())
entry1.delete(0, tk.END)
def button_channel():
with open('twitch_channel.txt', 'w') as channel_file:
channel_file.write(entry2.get())
entry2.delete(0, tk.END)
entry1 = tk.Entry(root, width=46, bg='#45A0D1').grid(row=0, column=1)
entry2 = tk.Entry(root, width=36, bg='#45A0D1').place(x=435,y=29, anchor=tk.CENTER)
tk.Button(root, text="Add", command=lambda: button_command(), bg='#0DB692').place(x=540,y=18, width=60, height=20)
tk.Button(root, text="Add", command=lambda: button_channel(), bg='#0DB692').place(x=540, y=0, width=60, height=20)
root.resizable(False,False)
root.mainloop()
if '__main__' == __name__:
main()