#!/usr/bin/env python from base64 import b64encode from sys import argv for fn in argv[1:]: with open(fn, "rb") as f: with open(fn + ".b64", "wb") as of: of.write(b64encode(f.read()))