Created
November 21, 2019 17:01
-
-
Save rogersguedes/3dd4622f69d7c61974a220cf446a00cf to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
def getBinStr(num, dig): | |
return format(num, '#0'+str(dig+2)+'b') | |
def getHexStr(num, dig): | |
return '0x{0:0{1}X}'.format(num, dig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment