newbie sending hex values over UDP socket

Bill Seitz fluxent at
Fri Sep 10 03:44:16 CEST 2004

I'm working with an outside "partner" to whom I want to send messages
(I want my app to send messages to his server/receiver). He requests
that I use UDP and an "industry standard" for formatting the data

That format is basically a bunch of hex bytes.

So instead of sending 3 alphanum chars

I have to send 3 bytes which he explains as being
  72 69 30

Now, what the heck should I really be sending? I know he's giving just
a simplified representation.

Am I really looking to send 
  (something else)?

If I'm aiming for the 2nd format, how do I best generate it? If I'm
going the other direction, it seems like
works OK

But going the other direction doesn't work:
  struct.pack('sss','r','i','0') -> 'ri0'

If I'm going for the first format, then I guess
is the answer, right?

Sorry for the silly question... I'm trying not to look like a chump
(to that partner)

More information about the Python-list mailing list