This is an old revision of the document!
Hex formatting variants: Hex and Hex1 through Hex8.
from cubloc import HexN # Natural width Hex(value: int) # Fixed width Hex1(value: int) ... Hex8(value: int)
value to format.HexN variants. Use 0 for natural width (Hex).Returns the formatted uppercase hexadecimal string using either natural width (Hex) or fixed-width right-justified text (Hex1 through Hex8).
Hex(value) returns natural-width uppercase hexadecimal text.Hex1..Hex8 return right-justified uppercase hexadecimal text in fixed-width fields.from cubloc import Hex, Hex2, Hex8 # Use Hex for natural width, or HexN variants for fixed width. value = 255 print(Hex(value)) # e.g. FF print(Hex2(value)) # e.g. 'FF' print(Hex8(value)) # e.g. ' FF'