File: transcode.py

package info (click to toggle)
haskell-base64-bytestring 1.2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: haskell: 1,014; python: 9; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 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()))