newbie string conversion question

Rohit kharifcrop at gmail.com
Sat Apr 1 09:17:41 EST 2006


As part of a proprietary socket based protocol I have  to convert a
string of length 10,

	say, "1234567890"

to send it as 5 characters such that their hex values are

	0x21 0x43 0x65 0x87 0x09

(Hex value of each character is got by transposing two digits at a
time)

 How can I do this in python? I would like the result to be available
as a string since I am concatenating it to another string before
sending it out. 

Thanks,
Rohit




More information about the Python-list mailing list