| 1 | #!/usr/bin/env python |
| 2 | from base64 import b64decode |
| 3 | from sys import argv |
| 4 | |
| 5 | for fn in argv[1:]: |
| 6 | with open(fn, "rb") as f: |
| 7 | with open(fn[:-4], "wb") as of: |
| 8 | of.write(b64decode(f.read())) |
| 9 |
| 1 | #!/usr/bin/env python |
| 2 | from base64 import b64encode |
| 3 | from sys import argv |
| 4 | |
| 5 | for fn in argv[1:]: |
| 6 | with open(fn, "rb") as f: |
| 7 | with open(fn + ".b64", "wb") as of: |
| 8 | of.write(b64encode(f.read())) |
| 9 |