15 Jul
2014
15 Jul
'14
6:26 p.m.
The second thing is that my own preferred format is "both" which sort of breaks your model:
out += "%04i x%04X: " % ((i * line_sz), (i * line_sz))
I think you could do this:
result = fmt % locals()
and then I could make a format like this to get what you want:
"%(line_sz)04i %(line_sz)04X"
Should be less code than what you have now and more flexible I think. Just catch ValueError, TypeError, and KeyError and you should be safe for error handling I think.
--Dan