Counting bytes

Hugo Martires hmartires at cultalg.pt
Mon Feb 25 09:27:51 EST 2002


See my point:
I need to send a list in a socket

server side
------------
list = [0.5 0.5 0.5 0.5]
client.socket.send(list)


client side
-------------
client.socket.recv(1024)

the problem is the buffer size (1024 bytes)
if i need to send a "big" list (with more than 1024 bytes), i have to count
the number of bytes to send in parts. So i must know how many bytes my list
oucupies.

Did your understand my problem ?
All the help you can provide will be apreciated.

Tanks


"Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote in message
news:j4664lllc6.fsf at informatik.hu-berlin.de...
> "Hugo Martires" <hmartires at cultalg.pt> writes:
>
> > And how can i count in a list ?
> > It is possible ?
>
> Read the source code. Alternatively, read the newsgroup archives,
> searching for "size" and "object", e.g.
>
>
http://groups.google.com/groups?hl=en&selm=j43d3m93iu.fsf%40informatik.hu-be
rlin.de
>
> This article also discusses the size of lists.
>
> Regards,
> Martin





More information about the Python-list mailing list