Related questions
String formatting: % vs. .format vs. string literal
Python 2.6 introduced the str.format() method with a slightly different syntax from the existing % operator. Which is better and for what situations?
Python 3.6 has now introduced another string formatting format of string literals (aka "f" strings) via the syntax f"…
python exception message capturing
import ftplib
import urllib2
import os
import logging
logger = logging.getLogger('ftpuploader')
hdlr = logging.FileHandler('ftplog.log')
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
FTPADDR = "some ftp …