How to use selected csv file in other py file

# def file_selector(folder_path='./datasets'):
#     filenames = os.listdir(folder_path)
#     selected_filename = st.selectbox("Select a File",filenames)
#     return os.path.join(folder_path,selected_filename)

# filename = file_selector()
# st.info("You Selected {}".format(filename))

# #Read Data
# df = pd.read_csv(filename)

this lines of code in my home.py file
now I try to use df in other file sub.py

create an function, and import your module by : from firstfile import myfunction