Python PEP 3101 and print() Overview

Python PEP 3101 specifies the string formatting function that replaces the old % operator on strings. In addition, PEP 3105 also specifies the behavior of the print(), now standard in Python 3. This post shows a small cheat-sheet or overview of both.

# Overview of PEP 3101 and PEP 3105
# In Python 2.7 use with:
from __future__ import print_function

# Print to stderr
>>> from sys import stderr
>>> print('ABC', file=stderr)

# Print without a newline
>>> print ...

Autodeploy a GitHub-hosted Pelican blog

If you have a Pelican blog or static site and you version control it using GitHub, this tutorial shows you how to auto deploy it to your web server each time you push your repository using webhooks.