wxPython 4 and PubSub

The Publish-Subscribe pattern is pretty common in computer science and very useful too. The wxPython GUI toolkit has had an implementation of it for a very long time in wx.lib.pubsub. This implementation is based on the PyPubSub package. While you could always download PyPubSub and use it directly instead, it was nice to be able to just run wxPython without an additional dependency.

However, as of wxPython 4.0.4, wx.lib.pubsub is now deprecated and will be removed in a future version of wxPython. So now you will need to download PyPubSub or PyDispatcher if you want to use the Publish-Subscribe pattern easily in wxPython.

Installing PyPubSub

You can install PyPubSub using pip.

Here’s how to do it:

pip install pypubsub

PyPubSub should install quite quickly. Once it’s done, let’s find out how to use it! Continue reading wxPython 4 and PubSub

Python for Programmers eBook Giveaway

UPDATE: All copies of the book have now been claimed! Thanks for checking it out!

Pearson recently contacted me about doing a giveaway of their new Python book, Python for Programmers: with Big Data and Artificial Intelligence Case Studies

I have 5 copies of the eBook to giveaway. All you need to do to claim a copy is tweet this article and tag me @driscollis and then send me a direct message on Twitter with the link or send the link to me via the Contact form on this blog.

Here’s some more information about the book from their website:

Written for developers with a background in any high-level language, Introduction to Python and Data Science for Programmers explores the Python language and Python APIs in depth, applying the Deitels’ signature live-code approach to teaching programming. Paul Deitel and Dr. Harvey M. Deitel present concepts in the context of fully tested programs, complete with syntax shading, code highlighting, line-by-line code walkthroughs, and program outputs. They feature hundreds of complete Python programs with nearly 20,000 lines of proven Python code, and hundreds of tips to help you build robust applications. You’ll start with an introduction to Python using an early classes and objects approach, and then rapidly move on to more advanced topics.

Throughout, you’ll enjoy the Deitels’ classic treatment of object-oriented programming. By the time you’re finished, you’ll have everything you need to build industrial-strength Python applications.

PyDev of the Week: Miro Hrončok

This week we welcome Miro Hrončok (@hroncok) as our PyDev of the Week! Miro teaches at Czech Technical University and helps out with the local PyLadies chapter. He is also involved with the Special Interest Group for Python in Fedora as he works for Red Hat in addition to his teaching position. You can check out some of the projects he is involved in over on Github or check out his website. Let’s take a few moments to get to know Miro better!

Can you tell us a little about yourself (hobbies, education, etc):

I’m a guy from Prague, Czech Republic, in my late twenties, yet both of my parents are from Košice, Slovakia, so I’m kinda both Czech and Slovak. I’ve studied Pascal at a gymnasium and later did my bachelors and masters in Computer Science/Software Engineering at the Faculty of Information Technology, Czech Tecnical University in Prague. Most of my hobbies are related to computers and technology but apart from that I have two Irish Wolfhounds and I love to ski.

One of my dogs when she was little

My technological interest has always been connected to Free and Open Source Software (and Hardware), starting with the Czech Linux community when I was a teenager, co-founding the RepRap 3D Printing Lab during my early years at the university and joining Fedora and later Red Hat, now working in the Python Maintenance team, also pro-active in the Czech Python community. Continue reading PyDev of the Week: Miro Hrončok

Book Review: Mission Python

A couple of months ago, No Starch Press asked me if I would be interested in reading one of their new books called Mission Python: Code a Space Adventure Game! by Sean McManus. I enjoy reading new tech books, but it’s hard to work them in when I’ve been so busy this past year. However one of my resolutions for 2019 is to read through my backlog of tech books, so I decided to tackle this one next!

Quick Review

  • Why I picked it up: Originally, the publisher asked me check the book out, but I was also interested because I think game programming is intriguing
  • Why I finished it: I mostly skimmed this book, but it’s definitely worth a read to see how to put a game together
  • I’d give it to: Developers that want to learn how quickly and easily it is to write a 2D game in Python

Continue reading Book Review: Mission Python

How to Distribute a wxPython Application

Let’s say you finished up a wonderful GUI application using wxPython. How do you share it with the world? This is always the dilemma when you finish an amazing program. Fortunately, there are several ways you can share your code. If you want to share your code with other developers, than Github or a similar website is definitely a good way to do. I won’t be covering using Git or Mercurial here. Instead what you will learn here is how to turn your application into an executable.

By turning your code into an executable, you can allow a user to just download the binary and run it without requiring them to download Python, your source code and your dependencies. All of those things will be bundled up into the executable instead.

There are many tools you can use to generate an executable:

You will be using PyInstaller in this tutorial. The main benefit to using PyInstaller is that it can generate executables for Windows, Mac and Linux. Note that it does not support cross-compiling. What that means is that you cannot run PyInstaller on Linux to create a Windows executable. Instead, PyInstaller will only create an executable for the OS that it is ran on. In other words, if you run PyInstaller on Windows, it will create a Windows executable only. Continue reading How to Distribute a wxPython Application

PyDev of the Week: Bruno Rocha

This week we welcome Bruno Rocha (@rochacbruno) as our PyDev of the Week! Bruno works for Red Hat and participates in the Python, Flask and Rust communities. You can see some of his projects over on Github or check out some of his writings on Medium. Let’s take a few moments to get to know Bruno better!

Can you tell us a little about yourself (hobbies, education, etc):

I’m Bruno Rocha, Software Engineer from São Paulo, Brazil.

I started playing with computers at a very young age when I was 12 when my mother gave me an old IBM XT 5160. After a few days playing DOOM and studying LOTUS 123 worksheets, I naturally became the computer boy in the family. I did a course of MS.DOS 6.22 (the novelty of that time) and learned to program some things with BASIC and dBase, a few years later the web appeared in Brazil and I started to make HTML sites with CGI in Perl and also to create programs with macros in MS Access 95.

I worked for some years as an instructor in basic computer courses, some jobs as a web designer, I also worked with network installation, PC building, and in 1998 I met Linux through Conectiva (A Brazilian Red Hat based distro). I got involved with Open Source and Linux and then I became sysadmin in hybrid networks with Linux and Windows NT.

Years later I joined the University of Information Systems and I graduated, during graduation I fell in love with programming and since then I have been working with software development, started some small business (in the days when we did not call it “startup”), I worked for Palm Inc. developed drivers and sales force systems for Palm OS with C, developed portals and CMS for several large companies in Brazil, taught online Python courses, worked in the Data Science team of the largest Job board in Brazil and since 2016 I have been dedicated to Quality Engineering and Test Automation at Red Hat.

Besides software and computers, I am vegetarian since I was born, and vegan for more than 15 years. I have been very active in animal rights activism movements and also in the rescue of abandoned animals (currently taking care of 32 rescued animals).

In my free time I love cooking vegan food but my favorite hobby is road cycling, I have participated in some vintage bike races with my Bianchi 1973 and my Caloi-10 1980, recently I became father of a boy, Erik is 3 months old and life has changed a little and since then my favorite hobby has been to sleep when I can. Continue reading PyDev of the Week: Bruno Rocha

PyDev of the Week: Maria Khalusova

This week we welcome Maria Khalusova ( @mariakhalusova) as our PyDev of the Week! Maria works for JetBrains and will be speaking at AnacondaCON this April. If you’d like to catch up with her, you can check out Maria’s blog. Let’s take a few moments to get to know Maria better!

Can you tell us a little about yourself (hobbies, education, etc):

Growing up I loved two things – math and books. I kid you not, I solved math problems for fun. Not surprisingly, I went on to study Applied Informatics at the Dept. of Mathematics and Mechanics of Saint Petersburg State University which I graduated from in 2007. This field is actually really close to modern Data Science, all the math parts of it were there, plus a good chunk of computer science program. I only wish I got to learn Python at my University and not Java 😀 Sadly, back then such fundamental packages like pandas and scikit-learn didn’t even exist yet.

Even before I graduated, I started working at JetBrains, first as a technical writer for IntelliJ IDEA. Fun fact: this June will be 13 years since I joined the company. I’ve changed projects, job roles, countries even, but not the company.

In recent years I’ve re-discovered my passion for math, data science, machine learning, and deep learning. I’ve brushed up on my rusty math knowledge and have been self-educating ever since. This is a never-ending process which I think is great. Continue reading PyDev of the Week: Maria Khalusova

Book Review: Serious Python

No Starch Press asked me to do a technical review of one of their upcoming books, Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More by Julien Danjou last year. I had never worked with No Starch before, but decided to give them a try and see how they differed from Packt Publishing. I ended up liking their process and the book was fun to read as well. It should be noted that No Starch did not ask me to do a book review. They only wanted me to do a technical review for them before the book was published.

I am writing this review because I think this book should get a little bit more notice. Also I interviewed its author a few years ago, so you might want to check that out too.

Quick Review

  • Why I picked it up: Originally, the publisher asked me to do a technical review
  • Why I finished it: The book covers intermediate level material and has an engaging writing style
  • I’d give it to: Beginners that want to grow beyond just knowing Python’s syntax

Continue reading Book Review: Serious Python

PyDev of the Week: Mariusz Felisiak

This week we welcome Mariusz Felisiak (@MariuszFelisiak) as our PyDev of the Week! Mariusz is a core developer of the Django web framework and a maintainer of the django-request package. You can follow Mariusz over on Github to see what he’s been up to. Let’s spend some time getting to know Mariusz!

Can you tell us a little about yourself (hobbies, education, etc):

Few facts from my life. I’m a software developer with over 11 years of experience in designing and implementing web applications. I graduated in Computer Science in 2010. I defended my PhD thesis related with numerical algorithms in 2018. I’ve done this after few years of coping in the same time with open source activities, daily job and PhD studies. It was a really intense time.

I’m always eager to contribute to open source projects which takes a large part of my free time, or at least it took before my daughter was born 🙂 I have been in love with Python and Django for 10 years. From 2017 I’m a member of the Django Core Team and the Django Software Foundations. In the middle of March I’m starting as a Django Fellow so Django will become my daily work! The funniest thing is that I should have more “free-time” 🙂 I’m a huge fan of open source and communities that stand behind them, that’s why I’m trying to be as involved as possible.

Outside of the tech world I’m a speedway fan who spends free-time on traveling and winter mountaineering. Continue reading PyDev of the Week: Mariusz Felisiak

Pros and Cons of Indy Publishing

I personally really love self-publishing or Indy Publishing, so I am a little biased. In this article, I will go over what I think are the pros and cons of Indy Publishing versus going with a “real” publisher.


Here are my favorite parts about indy publishing:

  • I control the release date
  • I control the content
  • eBooks can be updated within minutes
  • Your royalty rate is 70-90%
  • Prices can be changed in seconds
  • Flash sales are easy
  • It looks good on a resume / cv

I’m going to expand a bit on some of these points. I have worked with two publishers as an author: Packt Publishing and Apress. Packt has very aggressive timelines for getting things done. Chapters have to be done according to the schedule. A publisher can throw you curveballs when you are getting close to the end as well. When you self-publish, you control all of that. Continue reading Pros and Cons of Indy Publishing