This week we welcome Martin Fitzpatrick (@mfitzp) as our PyDev of the Week! Martin is the author of “Create Simple GUI Applications with Python and Qt 5” and the creator of the LearnPyQt website. You can also check out his personal site or see what he’s up to by visiting his Github profile. Let’s spend some time getting to know Martin better!
Can you tell us a little about yourself (hobbies, education, etc):
I’m a developer from the United Kingdom, who’s been working with Python for the past 12 years, and living in the Netherlands (Amersfoort) for the past 5.
I started coding on 8 bit machines back in the early 90s, creating platform games of dubious quality ” in my defence we didn’t have StackOverflow back then. Later I moved onto the PC, first writing DOS games and then, after someone invented the internet, doing a stint of web dev. I’ve been programming on and off ever since.
Rather than pursue software development as a career, I instead took a long detour into healthcare/biology. I worked first in the ambulance service, then as a physiotherapy assistant and finally completed a degree and PhD in Bioinformatics and Immunology. This last step was where I discovered Python, ultimately leading me to where I am now.
In my spare time I tinker in my workshop, creating daft electronic games and robots.
I like robots.
Why did you start using Python?
I first used Python back in 2007 when I was looking for at alternatives to building websites with Drupal/PHP. That led me to Django and Python. It felt so much simpler and more logical than what I’d used before, after knocking something together in an afternoon I was basically hooked.
For the next few years I was using Python almost exclusively for web development, and it probably would have stayed that way was it not for my PhD.
My thesis project was looking at the effects of metabolism on rheumatoid arthritis, and required me to analyse some big chunks of data. Having worked with Python for the previous 4 years it only seemed natural to try and use it here, rather than stop and learn R or MATLAB. The Python data analysis landscape was still a bit rough back then, but improving quickly ” pandas and Jupyter notebooks first appeared during this time. The final couple of years of my PhD I was looking to make the tools I’d written more accessible to non-technical users and started building GUI applications with PyQt5.
In the past couple of years I discovered microcontrollers (ESP8266 and Raspberry Pi) and have built some silly things with MicroPython.
What other programming languages do you know and which is your favorite?
Python is my favourite, hands down. There is something about the language that lines up very well with my brain, might be all the empty space.
I have learnt and forgotten quite a few languages including PHP, Pascal, Perl, Prolog and Z80 assembler. I can still bash something together in C and does MicroPython count as another language?
What projects are you working on now?
For the past month I’ve been working on updates to my PyQt5 book, Create Simple GUI Applications with Python & Qt and the accompanying PyQt5/PySide2 tutorials. There are plenty of good beginner resources available but once you get into developing real applications you’re a bit out of luck. I’ve now got a small team of writers together now which is really kicking things up a notch, it’s a lot of fun.
The site itself is custom built on top of Wagtail/Django, and I would like to make that available to other Python developers who want to host their own courses and tutorials.
Over on my workbench I have a few electronic game projects in progress using Python but can’t share anything yet. My biggest success to date was Etch-A-Snap a Raspberry Pi powered Etch-A-Sketch camera. Basically, you take a photo and it draws it automatically on a mini Etch-A-Sketch. That was bought by a Japanese collector which was kind of mind-blowing.
If anyone is interested in working with me I’m always open to collaborate!
Which Python libraries are your favorite (core or 3rd party)?
Python numeric libraries (numpy, scipy, pandas) and Jupyter notebooks are the big standouts for me. Collectively they have saved me hours upon hours of work, and having these kinds of tools available has been a major boost to Python’s popularity.
I think I have to say PyQt5/PySide2 here as well.
How did you become a self-published author?
When I started writing GUI applications in PyQt5 it was a bit of an uphill struggle. There were very few examples or tutorials available at the time, so I was stuck converting examples from C++. Once I had it figured out I just sat and wrote down everything I’d needed to learn on the way ” hopefully to save other people from the same fate. That was the first edition of the book, and I’ve been updating it regularly ever since.
Self publishing was just the simplest option to begin with, allowing me to concentrate on writing the book I wanted to read. Offers I have had from publishers all come with changes or restrictions on distribution I don’t agree with (the book is currently Creative Commons licensed).
Why did you choose PyQt over the other Python GUI toolkits?
During my PhD I was developing a tool for visualizing chemical pathways in cells and needed a good way to visualize overlaid pathways. The only solution I could find for this involved rendering using HTML/Javascript in an embedded window.
I built prototypes of the app with Tkinter, wxWidgets and Qt, and actually quite liked wxWidgets for its native widgets. But Qt was the only toolkit which shipped with its own built-in browser and so worked reliably across different platforms (I was on MacOS, my supervisor on Windows).
The rest, as they say, is history. The big benefit of Qt for me now is the QGraphicsScene vector graphics canvas which is great for interactive visualizations.
Do you have any advice for other potential authors?
Firstly, everybody knows something, or some combination of things or some things from a certain angle that is unique enough to form the basis of a book. Even if a book already exists in your niche, your own voice or experience is valuable.
Secondly, pick a topic that you’re interested in but that you also enjoy doing. Writing a programming book means writing a lot of example code, and if you don’t enjoy creating these things it’s going to be a unpleasant experience.
One of my first steps writing my book was to start a collection of example PyQt5 applications including clones of classics like Paint and Solitaire. This helped me figure out what was *required* knowledge, but ” more importantly ” it was a lot of fun.
Is there anything else you’d like to say?
I often get questions from Python developers who’ve come to programming a little later, asking “am I too old to start doing this professionally?”
The answer is no! I’ve had a career spanning admin (finance, human resources), healthcare (ambulance service, physiotherapy assistant, disability support worker), research scientist (PhD and post-doc) and landed my first actual “programming job” at 37.
One great advantage of learning to code in Python is that it can be applied to so many different problem domains. Whether you build your experience automating some office reports, doing data analysis or building websites, those skills will transfer and and your Python will improve.
Thanks for doing the interview, Martin!
Pingback: ICYMI CircuitPython Newsletter: Ports, app updates – CLUEs in the NEWs and more! #Python #Adafruit #CircuitPython #ICYMI @circuitpython @micropython @ThePSF @Adafruit « Adafruit Industries – Makers, hackers, artists, designers and engineers!