I used auto-py-to-exe to convert a project that has 3 py files to one .exe file. One of the scripts (not the main one) saves a pandas df as a csv at the same directory, and when you reopen the script, it reads the csv file. However when I turned the script into .exe, this part of the code doesn't work at all. I thought it might have saved it to a temp file, but if that was the case it would read the last saved dataframe.
Save csv:
path = pathlib.Path(__file__).parent
backup = fr"{path}\Product.csv"
main_df.to_csv(backup, encoding='utf-8',index=False)
Read csv:
main_df = pd.read_csv(fr"{path}\Product.csv.")
I'm using the same method to take backups of the dataframe, so I need the file in the same directory with .exe.
I researched about using multiple files while using "to one file" option and found this. I'm almost sure that one is the answer I seek, but I couldn't understand how to implement this to my code.