So, I'm creating a client manager software for a local club.
I'm using Python 3.5.1 and Tkinter.
Used a Notebook to nest my Frames.
On my first frame I made the form to add new clients (labels and textboxes) and an "add" button at the end.
Problem is that it executes the function associated with the button insted of onclick, and the button actually does nothing on click.
Been searching everywhere and it seems a rare problem.
Help?
I would try using lambda: before the command.
For instance, replace readFile(file) with lambda: readFile(file).
This will ensure an anonymous ("lambda") function with no parameters is passed, which upon execution will run the intended code. Otherwise, the function is executed once when the behavior is set, then the returned value is simply re-evaluated every time rather than the appropriate function being called.
Python 3.5.1, Tkinter: Functions execute on start instead of button click