john doe
john doe

Reputation: 2253

Passing two different functions in a button using Tkinter

I am trying to create a GUI with Python's Tkinter for some scripts and misc functions I have, the design of the GUI looks something like this:

Then, as the label says, I would like to transform a directory full of documents to a single .csv file, so I created two functions: My question is: How should I merge the two functions in the GUI's code?. I tried with a function that calls the two aforementioned functions, however, It did not work. I would also like to know if there is a better way to achieve this.

Upvotes: 0

Views: 177

Answers (1)

glls
glls

Reputation: 2403

As mentioned by @Brian Oakley, why haven't you tried including the two functions under 1, in this case, instead of configuring your button on click_me, include maybe the 2 other functions you mentioned?

def clickMe():

    action.configure(text='Hello ' + input_directory.get())
    retrive(input_directory.get())
    corpus_writer(output_directory.get())

Upvotes: 3

Related Questions