Reply To: Using file_selector ‘on_action’ callback

Welcome to Taipy Forums Taipy GUI Using file_selector ‘on_action’ callback Reply To: Using file_selector ‘on_action’ callback

Florian JactaFlorian Jacta

Hi Greg,

I have created a little code for you to help you use this control. This control is attached to a Python variable (here “path”). The value will be the path of the selected file. The real-time value of “path” can be found in the State object as below. The State object contains every GUI variable used by the application (—state).

from taipy.gui import Gui
import pandas as pd

path = None

md = “<|{path}|file_selector|label=Upload dataset|on_action=load_csv_file|extensions=.csv|>”

def load_csv_file(state):
data = pd.read_csv(state.path)


I hope that helps. If you need anything else, feel free to ask.