Sep-02-2018, 10:04 PM
I have an input field for a filepath in my script so the user can direct the script to a required spreadsheets location.
As this filepath is different PC to PC I want to store the last entered filepath as a default in the input field so once a user has entered the filepath the last file location is saved and only needs to be changed if on a different PC then again once its changed it is saved as default again etc etc.
My current work round to this is a default filepath actually in the code but what i want is when the user enters a new filepath that becomes the new default, even after the script is closed.
How is this possible to store this new default filepath ???
Initial research has brought the Shelve module to my attention but i dont know if this is the best solution
As this filepath is different PC to PC I want to store the last entered filepath as a default in the input field so once a user has entered the filepath the last file location is saved and only needs to be changed if on a different PC then again once its changed it is saved as default again etc etc.
My current work round to this is a default filepath actually in the code but what i want is when the user enters a new filepath that becomes the new default, even after the script is closed.
How is this possible to store this new default filepath ???
Initial research has brought the Shelve module to my attention but i dont know if this is the best solution
#GUI Variables IPT1 = Entry(IPT) #GUI Screen widgets IPT_Lab1 = Label(IPT, text="filepath : ", anchor=W) #Default Filepath entry IPT1.insert(0, r"C:\Users\x\y\z\spreadsheet.xlsx")