Maintenance of Application - For St. Thomas ITS
Updating the App
The application is written in python and contained within a single .py file. Should you need to edit it, you will need to download the most recent version of python to a computer and an editor. I personally use VS Code. At the top of the .py file I wrote a loop that installs all needed packages within the file, I recommend creating a new .py file and running the loop out of that or just in the terminal.
The application contains instructions about what things do to the best of my ability. If questions arise just reach out to me. The layout of the app and the GUI library takes some getting used to, but it is easier once looking at it a bit, it is difficult to explain ever single line in the GUI. I should add it is still much simpler than alternatives which is why I chose to use it.
Reason for some choices/FAQ
Why is it a single .exe file
Simplicity. I tried making the app run from a directory of folders and while it launched a tiny bit faster, it made it extremely difficult to update the application. Another reason I switched it was the size reduction that came from making it a single file, it was about 50-60mb less.
I am not a software engineer by any means and the realistic options we have for updating the application require manual placement of the app on the computers or using a script to automate it remotely. When trying to remove a directory (Folders) it would fail due to the computer not being able to close the app and its processes, so we couldn’t delete it when people were working. This left me several times waiting until after 10pm or waking up at 5am to remotely restart computers to kill the processes and deploy the application, which would at times take over 2 hours to copy every file and folder to each computer.
With the single exe file, we are not only able to kill the process at anytime, but also due to the reduced size the install/update time shortens to under 4-5 minutes.
Why is the source code contained within a single file instead of containerized
Growing off the above, simplicity.
I also prefer writing several files and calling them from within my code, it makes it nicer and cleaner. I think the source code is around 1800 lines of code so it is very overwhelming initially, it also at points is messy and not the cleanest code to look at.
The downside however of creating seperate files is needing to keep track of all the dependent files, for the sake of future upgradability I chose to contain the entire application and anything dependency I would normally contain in separate files within the actual .py file. My hope is that it makes updating simpler in the future, I have found it so when needing to compile it into an exe.
Why Python - More Specifics
Python is not the first choice for desktop application development typically due to how it operates and interacts with the computer. C, C#, C++ are sort of the gold standard for their speed and at times stability. Python however unlike those is very easy to write and extremely easy to read due to its syntax being very similar to common English. It is also a language often used for introductory programming classes, its simplicity makes it easy to learn for those new to coding, but powerful for those who already do know how to code.
For what we need and use at the Tech Desk, and as I found the limits placed on us in regard to permissions, python offered a significant upgrade in functionality not possible in AutoHotKey without losing any of the functionality previously maintained by the older application, there is even several libraries that mimic AHK within python.
Design Choices
I’ll be the first to admit that its not perfect, but its better.
I tried out several renditions of layouts and ideas we had relating to how it was organized and what would be available within the application. With the amount of info contained and easy of getting to it quickly the tab approach was best for what I was able to do within the python GUI library. The Home/Main page which doesn’t change contains things that you are expected to use in some fashion, the application is simply there to make it easier to do them, that follows for most of the information. Nothing within the app requires the application, but it makes it quicker or simpler. And that’s what the aim of the program is.
I hope this continues to be helpful for a while. Thank you :)