Skip to content

Instantly share code, notes, and snippets.

@dz1984
Last active December 16, 2015 04:59
Show Gist options
  • Save dz1984/5381161 to your computer and use it in GitHub Desktop.
Save dz1984/5381161 to your computer and use it in GitHub Desktop.
下載之後,再次執行轉換高低位元。 http://donaldknuth.blogspot.tw/2010/03/gae.html
in_file = file('some_file','rb');
out_file = file('some_file_decode','wb');
exchange = (lambda x: chr((lambda h:(ord(h)%16)*16)(x)+(lambda l:(ord(l)/16))(x)));
in_file.seek(0,2);
counter = in_file.tell();
in_files.seek(0,0);
while counter>0:
out_file.write(exchange(in_file.read(1)));
counter-=1;
in_file.close();
out_file.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment