Python shutil: High-Level File Operations Demystified

Are you looking to copy, move, delete, or archive data with your Python programs? If so, you’re in the right place because this article is all about the module that’s been specially designed for the job. It’s called shutil (short for shell utilities) and we’ll be demystifying its key features by way a few simple … Read more

Python List: Remove Duplicates and Keep the Order

Removing duplicates from a list is pretty simple. You can do it with a Python one-liner:Β  Python set elements have to be unique so converting a list into a set and back again achieves the desired result. What if the original order of the list is important though? That makes things a bit more complicated … Read more

Python String Formatting: How to Become a String Wizard with the Format Specification Mini-Language

Python provides fantastic string formatting options, but what if you need greater control over how values are presented? That’s where format specifiers come in.  This article starts with a brief overview of the different string formatting approaches. We’ll then dive straight into some examples to whet your appetite for using Python’s Format Specification Mini-Language in … Read more