View Single Post
  #19  
Old 03-07-2005, 11:06 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The value '\xhh' represents a character with a hex value of hh. In your case the character '\x80' would be equal to the hex number 0x80, which is 128. If you wanted to convert a number to this character format you would do the following:
Code:
val = chr(128)
The variable val will now hold the character '\x80'. To convert a character to the number format you would do the following:
Code:
val = ord('\x80')
I'm not sure what the pickle module does and why it converted the character to -128L, but if you are going to be reading the data character by character, then the above functions should be enough.
Reply With Quote