code: def hex_repr(d):
      
      txt = []
      for k, v in sorted(d.items()):
          if isinstance(v, int):
              txt.append("%s=%s" % (k, nice_hex(v)))
          else:
              txt.append("%s=%s" % (k, v))
      return " ".join(txt)
docs: >>> hex_repr({"A":0x1,"B":0xabc})
      'A=$01 B=$0abc'