Odd problem with converting string to Hex?

Benjamin Schollnick junkster at rochester.rr.com
Sun Jul 1 10:15:14 EDT 2001


Folks,

   This is odd.... or at least I think it is....

   Using Python v2.1....

   Here's a snippet of the data:

('.1.3.6.1.2.1.2.2.1.6.2', '\x00\x90\x83H\x11\x0f'), 
('.1.3.6.1.2.1.2.2.1.6.1', '\x00\x90\x83H\x11\x0f'), 
('.1.3.6.1.2.1.2.2.1.2.4', 'RF Upstream Interface')

   I've tried using:

      eval (data[1])
      hex (data[1])
      str(data[1])

   What gets returned is:

   Unknown - Mac?  --->    êÉH
            Hex:            Long: 

   Which os definetly not what I'm looking for.... I'm attempting to 
decode this in pure hexadecimal...

   I suspect it's due to the "\x" in the string, but I can't pull up the 
documentation, since when I tried I wasn't getting a response from 
python.org.....

   Conceptually I'm trying to output it, similiar to:

      00-90-83-11-0f    Assuming I'm reading the returned data properly.

         - Benjamin



More information about the Python-list mailing list