[Tutor] Help with storing a variable

nadeem nan nadeem_559 at yahoo.com
Tue Oct 31 07:43:35 EDT 2023


Hi Alan,
I hope you are doing well. I am a beginner at Python and as a practice trying to code a rental property management application using tkinter/ttkbootstrap as GUI and MS Excel to store the data.
In the application, the end user (here the property agent) can add tenants and their details, properties, rent etc. What I am trying to do is whenever the user adds a new tenant via the user interface, it will generate a tenant-code like MR0001 for a male tenant or MS0001  for a female tenant and the numbers would increment as more tenants are added. 
I was wondering how would I go about storing this tenant-code so when the user returns to the application to add more tenants the tenant-code is incremented from where it was left.
My idea is to store a variable for tenant-code some where in the excel sheet where the tenants data is being saved. This variable can be then accessed when the application is used and incremented accordingly. Do you think this idea would work or if you have a better and efficient way, please let me know.
I haven't started coding yet but just gathering ideas on paper. Any help will be much appreciated.
I look forward to hearing from you soon.

Regards,
Nadeem Nan
 

                                        


More information about the Tutor mailing list