Looking to start learning Python?

Begin Here

Category: intermediate

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

Python: All About Decorators

July 18, 2017 by Mike
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 […]

Python 201: A multiprocessing tutorial

August 2, 2016 by Mike
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: How to Create an Exception Logging Decorator

June 9, 2016 by Mike
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 201: An Intro to importlib

May 27, 2016 by Mike
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: Properties

January 20, 2014 by Mike
Python has a neat little concept called a property that can do several useful things. In this article, we will be looking into how to do the following: Convert class methods into read-only attributes Reimplement setters and getters into an attribute In this article, you will learn how to use the builtin class property in […]

Python Concurrency: Porting from a Queue to Multiprocessing

August 3, 2012 by Mike
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 […]
1 3 4 5
View More

End of content

No more pages to load

Copyright © 2022 Mouse Vs Python | Powered by Pythonlibrary