intermediate

These tutorials are for developers who already understand the basics of Python and they would like to expand their knowledge

Python 101 – Creating Multiple Processes

Most CPU manufacturers are creating multi-core CPUs now. Even cell phones come with multiple cores! Python threads can’t use those cores because of the Global Interpreter Lock. Starting in Python 2.6, the multiprocessing module was added which lets you take full advantage of all the cores on your machine. In this article, you will learn […]

Python 101 – Creating Multiple Processes Read More »

Python 101: Episode #25 – Decorators

In this episode, you will learn the basics of Python decorators and what the are good for. You can read the chapter this screencast is based on here: http://python101.pythonlibrary.org/ or purchase the book on Leanpub You can also read about decorators in a couple of other articles on my blog: Python: All About Decorators Python

Python 101: Episode #25 – Decorators Read More »

Python 201: A multiprocessing tutorial

The multiprocessing module was added to Python in version 2.6. It was originally defined in PEP 371 by Jesse Noller and Richard Oudkerk. The multiprocessing module allows you to spawn processes in much that same manner than you can spawn threads with the threading module. The idea here is that because you are now spawning

Python 201: A multiprocessing tutorial Read More »

Python: How to Create an Exception Logging Decorator

The other day, I decided I wanted to create a decorator to catch exceptions and log them. I found a rather complex example on Github that I used for some ideas on how to approach this task and came up with the following: # exception_decor.py import functools import logging def create_logger(): “”” Creates a logging

Python: How to Create an Exception Logging Decorator Read More »

Python 201: An Intro to importlib

Python provides the importlib package as part of its standard library of modules. Its purpose is to provide the implementation to Python’s import statement (and the __import__() function). In addition, importlib gives the programmer the ability to create their own custom objects (AKA an importer) that can be used in the import process. What about

Python 201: An Intro to importlib Read More »

Python Concurrency: Porting from a Queue to Multiprocessing

Earlier this week, I wrote a simple post about Python’s Queues and demonstrated how they can be used with a threading pool to download a set of PDFs from the United States Internal Revenue Service’s website. Today I decided to try “porting” that code over to Python’s multiprocessing module. As one of my readers pointed

Python Concurrency: Porting from a Queue to Multiprocessing Read More »