How to generate positional arguments for another function from tkinter entry How to generate positional arguments for another function from tkinter entry tkinter tkinter

How to generate positional arguments for another function from tkinter entry


You could do something like this:

It separates the concern of obtaining the data, and the responsibility of storing it. When you have more data fields to gather and store, only get_data will require updating.

def get_data():    food_ = food.get()    transport_ = transport.get()    insurance_ = insurance.get()    installments_ = installments.get()    others_ = others.get()    return food_, transport_, insurance_, installments_, others_def adddata():    data = get_data()    backend2.adddata(*data)