Python 101: Lambda Basics

Many programming languages have the concept of the lambda function. In Python, the lambda is an anonymous function or unbound function. The syntax for them looks a bit odd, but it’s actually just taking a simple function and turning it into a one-liner. Let’s look at a regular simple function to start off: #———————————————————————- def […]

Python 101: Lambda Basics Read More »

Python 201 – An Intro to Context Managers

Python came out with a special new keyword several years ago in Python 2.5 that is known as the “with statement”. This new keyword allows a developer to create context managers. But wait! What’s a context manager? They are handy constructs that allow you to set something up and tear something down automatically. For example,

Python 201 – An Intro to Context Managers Read More »