Sunday 24 May 2020

Creating a basic GUI in python

I have long wanted to create a GUI in python but have always found the thought a bit daunting because as a data engineer / scientist / analyst etc. it has never been my place (other than creating a few basic screens in APEX and dabbling a little with PowerBuilder). I guess the thing has always been where to start and thinking it was going to be very hard, not that I am put off from hard work but for a "fun" at home project it does need to be fun. 

As part of this fuzzy matching project I wanted the user to be able to pass in the files paths, at least to start with and hopefully develop from there. I came across PySimpleGUI and sure enough it looks simple, sure enough in no time at all I had built a very simple interface that allowed the user to enter 2 text fields that pass in file paths for csv files which are then loaded as dataframes. A message is displayed if one of the fields is blank, now I need a lot more validation but was very happy with this as a starting point. 

Here is a picture of the screen which is followed by the code. 






No comments:

Post a Comment