|
From: Tom V. <to...@so...> - 2010-03-08 21:36:06
|
Hi,
I know how to convert a hex string to an int. But how would I write
out the hex string? Thanks.
-Tom
class Preferences(ConfigObj):
def conv_hex(value):
return int(value, 16)
fdict = {
'hex': conv_hex,
}
def __init__(self, prefsname):
specsname = prefsname + '.spec'
if os.path.exists(specsname):
ConfigObj.__init__(self, prefsname,
configspec=specsname)
self.validate(Validator(self.fdict))
else:
ConfigObj.__init__(self, prefsname)
|