Dec-14-2019, 01:46 PM
Hi there.
A newbie here wanna ask a newbie question.
Background info:
I've been working actively on an excel project for the last 2 years. It started out small and has been progressively getting bigger and bigger and has gotten to the stage where updating users, departments etc has become a pain.
To make things easier i have moved most of that kind of info into XML files so that they may be edited in a central location and then the changes can be reflected across the rest of the spreadsheets. (over approx 300 of them and that count will increase by approx 120 per year).
To make things easier I wanted to create a web interface where they are able to get a list of completed spreadsheets and also the level of completion and as users always do they give you all the impossible requests to do, so they requested the spreadsheets be to be opened from the web interface and bingo, it all fell apart. Apparently you cannot access your local file system for that.
I did it with some OLD tech(HTA) but I'm not happy with this so I'm turning to Python for a solution.
The plan is to have a simple exe file in the end with a simple interface that they may look at the data and then with the click of a button open one of the spreadsheets and do their damn work :)
Ok now to the question(sorry it took so long)
Reading the info into python is easy with ElemenTree but how do I save that data in python. My initial instinct was to go with Dictionaries. Each user, department and also each spreadsheet has a unique ID. So if <User045> has a task to complete for <Dept004> in spreadsheet <Control089> it would be easy. If I set up my dictionaries in such a way the the "Key" corresponds to the unique ID's there is no need to iterate through a dictionary, i can just say userdict(User045) and have that users info available to me.
If I do the class thing however, each users class instance have to go into a list and then when i need a specific user's info i have to iterate through the list to get to the reference if that users class instance and then retrieve the data.
This is all making me super confused. What do I do?
A newbie here wanna ask a newbie question.
Background info:
I've been working actively on an excel project for the last 2 years. It started out small and has been progressively getting bigger and bigger and has gotten to the stage where updating users, departments etc has become a pain.
To make things easier i have moved most of that kind of info into XML files so that they may be edited in a central location and then the changes can be reflected across the rest of the spreadsheets. (over approx 300 of them and that count will increase by approx 120 per year).
To make things easier I wanted to create a web interface where they are able to get a list of completed spreadsheets and also the level of completion and as users always do they give you all the impossible requests to do, so they requested the spreadsheets be to be opened from the web interface and bingo, it all fell apart. Apparently you cannot access your local file system for that.
I did it with some OLD tech(HTA) but I'm not happy with this so I'm turning to Python for a solution.
The plan is to have a simple exe file in the end with a simple interface that they may look at the data and then with the click of a button open one of the spreadsheets and do their damn work :)
Ok now to the question(sorry it took so long)
Reading the info into python is easy with ElemenTree but how do I save that data in python. My initial instinct was to go with Dictionaries. Each user, department and also each spreadsheet has a unique ID. So if <User045> has a task to complete for <Dept004> in spreadsheet <Control089> it would be easy. If I set up my dictionaries in such a way the the "Key" corresponds to the unique ID's there is no need to iterate through a dictionary, i can just say userdict(User045) and have that users info available to me.
If I do the class thing however, each users class instance have to go into a list and then when i need a specific user's info i have to iterate through the list to get to the reference if that users class instance and then retrieve the data.
This is all making me super confused. What do I do?