Week 7: GUI Touchups and Alternatives

Apr 30, 2020

Hello Again,

This past week was good, and as we approach the end of the Senior Project period, my work has involved less building and more touching up. In my meeting at the beginning of the week, my onsite advisor and I came up with a few different things I should do in Week 7. I organized my code, posted my work on GitHub, looked into possible alternatives for GUI, and implemented a few smaller coding techniques such as switch statements.

Progress

I first started by cleaning up my code. I took ‘organization’ to not only mean putting similar functions in the same area but also describe what is going on inside the code. By typing ‘#,’ everything written after it on that same line is in comment mode. It doesn’t do anything and is usually used for tips or descriptions. First, I went through and grouped all of the similar functions. For example, I put everything that has to do with importing and parsing the .XML file at the beginning. After separating the script into sections, I wrote a sentence or two in front of some of the functions – especially the important ones. Putting structure and descriptions into my code was partly for me – the entire script is over 250 lines, so finding one particular function is tough. But it was mainly for the benefit of anyone that was to look at my code with fresh eyes.

You may be thinking, “Oh Tommy, how naive of you to assume that anybody has clicked on the links to your Python script and tried to understand it.” Well, you may have been right before, but as of this week, I have all of my code and XML files posted on GitHub, where anybody on the internet can easily find and use it. GitHub is a website where people can post their work, and for the more expert projects that have multiple people working on one project, it provides version control. Version control is when specific versions of something are saved and can be accessed later. Anyways, uploading my work to GitHub was a relatively easy task – almost like creating a social media account and posting a picture. Looping back to why I put descriptions in my code, if anyone were to come across my work from GitHub – someone with even less background than you do – these would help guide the reader through my script.

Although I said my work has been less focused on building up, I did look around at some different GUI packages that I could theoretically use instead of the one I am using now, PySimpleGUI. However, this job was not very pressing – the only reason why the package I am using now is insufficient is that there is a limited color availability on the table function. I assumed that it wouldn’t be very hard to find a better one that makes up for this insufficiency. After all, I chose PySimpleGUI for its implied simplicity because I was very new to designing User Interfaces. This week, with more confidence, I researched the table functions on the highest rated GUI libraries. Sadly, it seems like tables are limited with most of them because of the input; as I have said before, the table functions take in indexes as data, and you can’t really add color to a data set.

Finally, there were a couple of techniques that I attempted to employ in my code. These were more for learning than they were for efficiency or utility. A primary example is switch/case statements, which use the value of a variable to signal an outcome. They have the same function as a bunch of “if” statements in a row, except they search for what to do with a specific value rather than running through each if statement and returning True or False.

 

Next steps + Experience

Did I tell you last week that I would use my GUI in a test environment for one of Unanet’s customers? Yes. Did I keep my promise? Not exactly. Apparently, this process takes a long time, so my onsite advisor and I blocked off 2 hours on a day next week to run it through. Even though I didn’t get to it this week, I am excited that my work is ready to be used in the real world.

I see the light at the end of the tunnel. This is not at all implying that the Senior Project represents darkness, or that I crave said light, but I am eager to see how my and all of my classmates’ projects turn out! Stay tuned for next week, and please leave a comment with any thoughts or questions you have.

One Reply to “Week 7: GUI Touchups and Alternatives”

  1. Charles T. says:

    I see a light too! We’re so close with our projects.

Leave a Reply

X