Le Tue, 5 May 2009 00:52:11 +0100, "Alan Gauld" <alan.ga...@btinternet.com> s'exprima ainsi:
> > Is there a way in Python to say this is a string of HEX characters like > > Perl's pack? Right now I have to take the string and add a \x to every > > two > > values i.e. \x41\x42... > > Assuming you actually want to send the hex values rather than > a hex string representation then the way I'd send that would be > to convert that to a number using int() then transmit it using > struct() I can hardly imagine why you want an hex string representation for further process instead of the values, neither. Would be interested in the reason for this. Assuming that an interface require hex string, wouldn't it be easier to change this so that it directly gets values? Id est avoid double format conversion. Denis ------ la vita e estrany _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor