Skip to content

Instantly share code, notes, and snippets.

@berenoguz
Created October 7, 2017 00:31
Show Gist options
  • Save berenoguz/b632cebf4c0ebfe1da5246e5d8552ac6 to your computer and use it in GitHub Desktop.
Save berenoguz/b632cebf4c0ebfe1da5246e5d8552ac6 to your computer and use it in GitHub Desktop.
Super simple hex to bin utility
from sys import argv
l = 32
s = bin(int(argv[1], 16))[2:].zfill(l)
try:
i = 2
while argv[i]:
argv[i] = int(argv[i])
s = s[:l-argv[i]] + " " + s[l-argv[i]:]
l -= argv[i]
i += 1
except IndexError:
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment