Use The Underscore in The REPL
You can obtain the result of the last expression in a Python REPL with the underscore operator, e.g. in the Python REPL this looks like: … read more
Read the latest blog articles from Python Land, about Python and related topics.
You can obtain the result of the last expression in a Python REPL with the underscore operator, e.g. in the Python REPL this looks like: … read more
One of the earliest Python PEP’s is PEP-20, written in 2004. It lists 19 theses or rules for Python programming called The Zen of Python. … read more
Python has a long history, starting around 1991 with its first release in a newsgroup called alt.sources. Since then, we all know how omnipresent the … read more
The Pillow Python Imaging Library is ideal for image processing. Typically, it’s used for archival and batch processing applications. Of course, you’re free to use … read more
There’s a package for pretty much everything you can think of in the Python ecosystem, all installable with a simple pip command. So it shouldn’t … read more
With this trick, you can quickly convert a Python string to title case. To quote from the Wikipedia article: “Title case or headline case is a style of capitalization used … read more
With this neat little trick, you can swap two Python variables without using a third variable: It’s just one line of code! As you can … read more
A Python data class is a regular Python class that has the @dataclass decorator. It is specifically created to hold data. Since Python version 3.7, … read more
With Python, we can return multiple values at once. Obviously, most functions in Python return a single value, usually the result of the work done … read more
With sys.getsizeof() you can check the memory usage of an object. To do so, first import the module sys: Woah… wait… why is this huge … read more