10 def somedecode(infilename, outfilename):
11 with open(infilename, 'r') as infile:
12 infilestr=infile.read()
17 if c in "abcdefghinjklmnopqrstuvwxyz":
19 elif c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
24 bitstrstr = bitstrstr[:-(len(bitstrstr)%8)]
28 retstr = binascii.unhexlify('%x' % int(bitstrstr, 2))
29 open(outfilename, 'w').write(retstr.decode())
32 if __name__ == "__main__":
33 def signal_handler(signal, frame):
34 print('SIG received. exitting!')
36 signal.signal(signal.SIGINT, signal_handler)
38 somedecode("out.txt", "dec.txt")