S Smith revised this gist . Go to revision
2 files changed, 16 insertions
b64dec.py(file created)
| @@ -0,0 +1,8 @@ | |||
| 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())) | |
b64enc.py(file created)
| @@ -0,0 +1,8 @@ | |||
| 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())) | |