Python is a powerful scripting language that is easy to use. Here we will list some of the real world examples that we use in our daily work. These are mostly easy operations. Writing proper software to perform these operations is often time consuming. Python is a perfect tool for such simple tasks as replacing strings in file, searching and parsing files, making changes in documents automatically.

Parse Apache log files with Python

We run our website on Apache servers and they generate a huge amount of log files every day. Looking through these files is a full time job, so we decided to parse them automatically to retrieve the data about possible 404 and 403 errors.

Send email with Python

Sending emails with Python scripts is easy if you have a server running. There are several libraries you need to use.

Replace string in XML file with Python

In this example we will show how to read XML and CSV files with Python, and perform search and replace operations. The result will be written into a new file with the same filename, but with “_new” appended to the filename.