#!/usr/bin/python

"""Translates a string of hex values to CP437 characters. Characters not in [0-9A-F] are ignored"""

import sys, re
s = sys.stdin.read()
s=re.sub(r"[^0-9A-F]","",s)
r=''
i=0
while i < len(s):
    r = chr(int(s[i:i+2],16))
    i+=2
print r
@@ -164,16 +164,17 @@
 b(r%22
+(
 %5B%5E0-9A-F
 %5D%22,%22
@@ -173,17 +173,21 @@
 9A-F
-%5D
+a-f%5D)
 %22,%22%22,s)%0A
 r=''
@@ -182,16 +182,24 @@
 %22,%22%22,s)%0A
+print s%0A
 r=''%0Ai=0
@@ -223,16 +223,17 @@
 :%0A    r 
++
 = chr(in

fix translate.py