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: An Intro to Regular Expressions

Regular expressions are basically a tiny language all their own that you can use inside of Python and many other programming languages. You will often hear regular expressions referred to as “regex”, “regexp” or just “RE”. Some languages, such as Perl and Ruby, actually support regular expression syntax directly in the language itself. Python only

Python: An Intro to Regular Expressions 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 »

PyDev of the Week: Wesley Chun

This week we welcome Wesley Chun as our PyDev of the Week! Wesley Chun, MSCS, is author of Prentice Hall’s bestselling “Core Python” series (corepython.com), the “Python Fundamentals” companion videos, co-author of “Python Web Development with Django” (withdjango.com), and has written for Linux Journal, CNET, and InformIT. In addition to being an engineer at Google,

PyDev of the Week: Wesley Chun Read More »