"%s" % var → "{}".format(var)

Just a small change, but I think in python 3 this is the preferred way to put strings together :)