my first socket !
Ian Bicking
ianb at colorstudy.com
Tue Feb 18 04:23:52 EST 2003
On Tue, 2003-02-18 at 03:15, Franck Bui-Huu wrote:
> I'm currently trying to receive data from a socket with
> data = mysock.recv(LENGTH)
> the fisrt byte of data is the length of data to receive.
> If I print the length I get : print data[0] -> "\x04"
> How can I "cast" it in order to handle it as an int whose value is 4 ?
ord("\x04") == 4
--
Ian Bicking ianb at colorstudy.com http://colorstudy.com
4869 N. Talman Ave., Chicago, IL 60625 / 773-275-7241
"There is no flag large enough to cover the shame of
killing innocent people" -- Howard Zinn
More information about the Python-list
mailing list