All posts by Mike

Python is #1 in 2017 According to IEEE Spectrum

It’s always fun to see what languages are considered to be in the top ten. This year, IEEE Spectrum named Python as the #1 language in the Web and Enterprise categories. Some of the Python community over at Reddit think that the scoring of the languages are flawed because Javascript is below R in web programming. That gives me pause as well. Frankly I don’t really see how anything is above Javascript when it comes to web programming.

Regardless, it’s still interesting to read through the article.

Related Articles

Python: All About Decorators

Decorators can be a bit mind-bending when first encountered and they can also be a bit tricky to debug. But they are a neat way to add functionality to functions and classes. Decorators are also known as a “higher-order function”. What this means is that they can take one or more functions as arguments and return a function as its result. In other words, decorators will take the function they are decorating and extend its behavior while not actually modifying what the function itself does.

There have been two decorators in Python since version 2.2, namely classmethod() and staticmethod(). Then PEP 318 was put together and the decorator syntax was added to make decorating functions and methods possible in Python 2.4. Class decorators were proposed in PEP 3129 to be included in Python 2.6. They appear to work in Python 2.7, but the PEP indicates that they weren’t accepted until Python 3, so I’m not sure what happened there.

Let’s start off by talking about functions in general to get a foundation to work from. Continue reading Python: All About Decorators

PyDev of the Week on Hiatus

I don’t know if anyone noticed something amiss this week, but the PyDev of the Week series is currently on hiatus. I have been having trouble getting interviewees to get the interviews done in a timely manner the last month or so and actually ended up running out.

While I have a bunch of new interviewees lined up, none of them have actually finished the interview. So I am suspending the series for the month of July 2017. Hopefully I can get several lined up for August and get the series kicked back into gear. If not, then it will be suspended until I have a decent number of interviews done.

If you happen to have any suggestions for Pythonistas that you would like to see featured here in the PyDev of the Week series, feel free to leave a comment or contact me.

Meta: The new Mouse Vs Python Newsletter

I recently decided to try giving my readers the option of signing up for a weekly round up of the articles that I publish to this blog. I added it to my Follow the Blog page, but if you’re interested in getting an email once a week that includes links to all the articles from the past week, you can also sign up below:

Subscribe to a weekly email of the blog

* indicates required




I will note that this is a bit experimental for me and I am currently attempting to get the emails formatted correctly. I believe I finally have something that looks right, but there may be some minor changes that happen over the next couple of weeks as I learn the platform.

wxPython – Getting Data From All Columns in a ListCtrl

Every now and then, I see someone asking how to get the text for each item in a row of a ListCtrl in report mode. The ListCtrl does not make it very obvious how you would get the text in row one, column three for example. In this article we will look at how we might accomplish this task.


Getting Data from Any Column

Let’s start by creating a simple ListCtrl and using a button to populate it. Then we’ll add a second button for extracting the contents of the ListCtrl: Continue reading wxPython – Getting Data From All Columns in a ListCtrl

PyDev of the Week: David Wolever

This week we welcome David Wolever (@wolever) as our PyDev of the Week. David is the co-founder of PyCon Canada and Akindi.com – a small company that’s making multiple-choice bubble sheet tests a little bit less terrible. He is also the author of the nose-parameterized project and the pprint++ project. You can also check out what other projects he contributes to on Github. Let’s take a few moments to get to know David!

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

I’m a long-time Python fan and startup founder from Toronto, Canada. I dropped out of software engineering at the University of Toronto when I realized that I was interested in building software, not proving runtime bounds of graph search algorithms (although I’m incredibly grateful to the people who do enjoy that), and I’ve been working with small startups ever since.

I’m the CTO of my company, Akindi, makes Scantron-style multiple choice bubbles sheets a little bit less terrible.

In 2012 some friends and I started PyCon Canada, and I’m incredibly excited that it’s going to be held in Montréal this year (get your tickets now, because they’re going to sell out: https://pycon.ca)

Outside of computers, I’m really into knots (top three: alpine butterfly, jug sling hitch, chain sinnet) and motorcycling.

I tweet at https://twitter.com/wolever Continue reading PyDev of the Week: David Wolever

Book Review: Software Architecture with Python

Packt Publishing approached me about being a technical reviewer for the book, Software Architecture with Python by Anand Balachandran Pillai. It sounded pretty interesting so I ended up doing the review for Packt. They ended up releasing the book in April 2017.


Quick Review

  • Why I picked it up: Packt Publishing asked me to do a technical review of the book
  • Why I finished it: Frankly because this was a well written book covering a broad range of topics
  • I’d give it to: Someone who is learning how to put together a large Python based project or application

Continue reading Book Review: Software Architecture with Python

PyDev of the Week: Aileen Nielsen

This week we welcome Aileen Nielsen as our PyDev of the Week. Aileen has been using Python in the data science field for a while now. She recently gave a tutorial on Time Series Analysis at PyCon 2017 and she also did a talk on NoSQL Python at PyData Amsterdam 2016. Let’s take a few moments to learn more about our fellow developer!

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

I’m a software engineer at One Drop, a diabetes management platform. We’re trying to help people better understand and manage their chronic conditions with the use of technology, data analysis, and expert coaching.

I spent a lot of time in school (law school, ABD in physics grad school), so I consider myself an eclectic person as far as academic interests, and I like to read non-fiction in lots of area. Right now I’m most interested in non-fiction books about spying and organized crime. My hobbies are traveling and hiking. When I’m not working, I try not to be in front of a screen.

Continue reading PyDev of the Week: Aileen Nielsen

Python 101: Working with Dates and Time

Python gives the developer several tools for working with dates and time. In this article, we will be looking at the datetime and time modules. We will study how they work and some common uses for them. Let’s start with the datetime module!

The datetime Module

We will be learning about the following classes from the datetime module:

  • datetime.date
  • datetime.timedelta
  • datetime.datetime

These will cover the majority of instances where you’ll need to use date and datetime object in Python. There is also a tzinfo class for working with time zones that we won’t be covering. Feel free to take a look at the Python documentation for more information on that class. Continue reading Python 101: Working with Dates and Time

ANN: Boomslang XML

I recently decided to start putting together some fun example desktop applications using Python. I’ve been using wxPython to create the cross platform applications. My first one is called Boomslang XML and is a basic XML editor.

The name, Boomslang, comes from a large venomous snake. It’s name basically means “tree snake”, which I thought was appropriate since the user interface uses a tree widget to represent the structure of the XML document.

The current features in Boomslang include the following:

  • Opening / Editing multiple XML files
  • Auto save on edit of the XML
  • Recent file support
  • Some keyboard shortcuts (accelerators)
  • Add new XML nodes or attributes
  • Edit nodes and attributes
  • Delete nodes

Currently this is fairly beta, but I thought other people might find it interesting. I am aware of a couple of issues with it currently, such as the inability to delete attributes or not being able to add an XML node with spaces in it But I will get those fixed soon. In the meantime, feel free to check out the project over on Github.

Note: This project was tested with Python 2 and 3, wxPython 2.9, 3.0, and 4.0 using the lxml package on Windows 7, Xubuntu 16.04 and Mac OSX Sierra.