IT developer, trainer, and author. Coauthor of the Debian Package Management Book (http://www.dpmb.org/).
Reading Files with Python
To work with stored data, file handling becomes the core knowledge of every professional Python programmer. Right from its earliest release, both reading and writing data to files are built-in Python features. In comparison to other programming languages like C or Java, it is pretty simple and only requires a...
Reading and Writing Lists to a File in Python
Python programmers intensively use arrays, lists, and dictionaries as serialized data structures. Storing these data structures persistently requires either a file or a database to properly work. In this article, we'll take a look at how to write a list to file, and how to read that list back into...
Writing Files using Python
As pointed out in a previous article that deals with reading data from files, file handling is essential knowledge of every professional and hobbyist Python programmer. This feature is a core part of the Python language, and no extra module needs to be loaded to do it properly. In this...
Python String Interpolation with the Percent (%) Operator
There are a number of different ways to format strings in Python, one of which is done using the % operator, which is known as the string formatting (or interpolation) operator. In this article we'll show you how to use this operator to construct strings with a template string and variables...
As already pointed out in a previous article titled Commenting Python Code you have learned that documentation is an essential, and a continuous step in the process of software development. The article mentioned above briefly introduced the concept of docstrings which is a way to create documentation for your Python...
Rounding Numbers in Python
Using a computer in order to do rather complex Math is one of the reasons this machine was originally developed. As long as integer numbers and additions, subtractions, and multiplications are exclusively involved in the calculations, everything is fine. As soon as floating point numbers or fractions, as well as...
Working with PDFs in Python: Inserting, Deleting, and Reordering Pages
This article is the third in a series on working with PDFs in Python: Reading and Splitting Pages Adding Images and Watermarks Inserting, Deleting, and Reordering Pages (you are here) This article is part three of a little series on working with PDFs in Python. In the previous articles we...
Working with PDFs in Python: Adding Images and Watermarks
This article is the second in a series on working with PDFs in Python: Reading and Splitting Pages Adding Images and Watermarks (you are here) Inserting, Deleting, and Reordering Pages Today, a world without the Portable Document Format (PDF) seems to be unthinkable. It has become one of the most...
Working with PDFs in Python: Reading and Splitting Pages
This article is the first in a series on working with PDFs in Python: Reading and Splitting Pages (you are here) Adding Images and Watermarks Inserting, Deleting, and Reordering Pages Today, the Portable Document Format (PDF) belongs to the most commonly used data formats. In 1990, the structure of a...