I’m trying to build my first Flet App. In order for my script to work, I need to read in data (e.g. Pandas-DataFrames as Pickle-Files) and I also import functions from separate scripts (not the main.py script). I would later like to compile the App using the build command, so tried placing all files and scripts in subdirectories of the assets folder of my Flet project. However, I don’t get how to correctly specify the filepaths later in my script. Does anyone know how to correctly do this?
I tried the following, but it won’t work when running the App via the run command.
def main(page: ft.Page):
data_path = '/data/data.pkl'
df = pd.read_pickle(filepath_or_buffer = data_path)
from assets.scripts.gui_plots import ErrorHist
ft.app(target = main, assets_dir = ‘assets’)
Stresser Beats is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.