This is one of my first real projects that I had to design a GUI for from the ground up. I’ve tried out a lot of different GUI libraries and even had to do some with Java using JavaFX. I really liked the flexibility and versatility that PyQt had so I stuck with it. I had some time to play around with it with another project but I never had to build it with input so this was an entirely new experience to me.
function
- Visualizes different sorts
- Can generate random array of numbers
- Can generate descending array of numbers
- Has a speed slider to change how fast/slow the sorting and generating goes
sorts
- Bubble
- Insertion
- Selection
- Shell
what i learned
- More Python practice.
- PyQt5 for GUI.
- QtDesigner.
- General GUI design ideas.
- Better understanding of sorting algorithms.
- Some CSS.
resources
- My GitHub Repo
- LearnPyQt
- GeeksForGeeks Bubble Sort
- GeeksForGeeks Insertion Sort
- GeeksForGeeks Selection Sort
- GeeksForGeeks Shell Sort
notes
I’ve been wanting to make this project for a long time now and tried to dip my feet into the world of GUI building. I first started with Tkinter for python and managed to visualize two sorts. The issue with the way I did was that it didn’t have any user input at all and the sorts would visualize one after the other. It also pre-generated a random array whenever it starts and would just exit once it’s done sorting. I tried a different approach by using PyQt for GUI which allowed me to use QtDesigner in order to design and flesh out the GUI then I just programmed the wanted behavior afterwards. I learned a lot about what goes into building GUIs and things that came with it such as signals from user input. I also learned a little CSS in order to make the progress bars look the way I wanted to.