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