Last active
December 16, 2015 04:59
-
-
Save dz1984/5381161 to your computer and use it in GitHub Desktop.
下載之後,再次執行轉換高低位元。 http://donaldknuth.blogspot.tw/2010/03/gae.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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