I'm new to Tkinter, and also new to this forum. I am trying to learn to use Tkinter, and I have a problem!
I want to save some text to a text file by writing the text and then press a button to run a function that saves the info. But it seems like my "command" does not start the function.
def ny_artikel():
artikel_data = open ("artikel_databas.txt", "w")
artikel_data.write(ny_artikel.get())
artikel_data.close ()
spara_artikel = Button(new_product_window, text ="Save new article", command = ny_artikel)
spara_artikel.grid(row=7, column=1)
ny_artikel
is an entry box used in my program, but I think it's too many rows to paste it all in here.
When I press the button, nothing at all happens. Not even an error message.