Some people complained about my last logging article, wondering if it was even necessary since the docs and Doug Hellman have already written on the topic. I sometimes wonder why I write on these topics too, but usually when I do, I get lots of readers. In this case, I've gotten almost 10,000 hits just […]
I am currently working on a book review for a college course Python book that uses the Python turtle module and Tkinter to help teach the Python programming language. Hopefully I'll have that book done by the end of the month. In the mean time, it made me decide to give the turtle module a […]
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 provides a very powerful logging library in its standard library. A lot of programmers use print statements for debugging (myself included), but you can also use logging to do this. It's actually cleaner to use logging as you won't have to go through all your code to remove the print statements. In this tutorial […]
Python comes with a lot of cool concurrency tools builtin, such as threads, Queues, semaphores and multiprocessing. In this article, we'll spend some time learning how to use Queues. A Queue can be used for first-in-first out or last-in-last-out stack-like implementations if you just use them directly. If you'd like to see that in action, […]
Every now and then you'll find yourself needing to load modules or classes dynamically. In other words, you'll want to be able to import a module without knowing ahead of time which one you're going to import. In this article, we'll look at two ways to accomplish this feat in Python. Using the __import__ Magic […]