[Tutor] revisiting struct module

shawn bright nephish at gmail.com
Thu Sep 28 20:31:39 CEST 2006


Hey there,
I am writing this because there is something that I am not understanding
about the struct module.
I have to send a message over a socket. The message has to be exactly 4
bytes, and the last bit has to be the value of 200.
so like this:
null,null,null,200 would be the message, and the 200 has to be an unsigned
long int.

I know the stream of info that I am supposed to send the server is big
endian.
I also know that I should be using the struct.pack(), but I don't know how
to set this up.

This is actually only part of the message, but I am trying to learn this as
i go.

thanks for any tips.

shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060928/363cbc12/attachment.htm 


More information about the Tutor mailing list