Skip to content

Instantly share code, notes, and snippets.

@dbasch
Created January 27, 2013 03:42
Show Gist options
  • Save dbasch/4646154 to your computer and use it in GitHub Desktop.
Save dbasch/4646154 to your computer and use it in GitHub Desktop.
with open("file.bin", "rb") as infile, open("reversed", "wb") as outfile:
data = infile.read()
for i in xrange(len(data) / 2):
outfile.write(data[i*2+1])
outfile.write(data[i*2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment