Skip to content

Instantly share code, notes, and snippets.

@philpennock
Created September 4, 2016 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philpennock/0df738bc6861968b7d7b1e616a65a66d to your computer and use it in GitHub Desktop.
Save philpennock/0df738bc6861968b7d7b1e616a65a66d to your computer and use it in GitHub Desktop.
Convert hex-dump format (hh hh hh hh) to binary data: fast hack at REPL, for an HVIF file
#!/usr/bin/env python3
import binascii
with open('foo.hvif', 'wb') as out:
out.write(binascii.unhexlify(b''.join(open('foo.hvif.txt', 'rb').read().split())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment