File: transcode.py

package info (click to toggle)
haskell-base64-bytestring 1.0.0.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 124 kB
  • sloc: haskell: 555; python: 9; makefile: 3
file content (14 lines) | stat: -rwxr-xr-x 247 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python

import binascii, sys

funcs = {
    'decode': binascii.a2b_base64,
    'encode': binascii.b2a_base64,
    'read': lambda x:x,
    }
    
f = funcs[sys.argv[1]]

for n in sys.argv[2:]:
    sys.stdout.write(f(open(n).read()))