[Tutor] using sockets to send a list

Adrian Maier am@fx.ro
Sat Feb 22 23:19:01 2003


On Sat, Feb 22, 2003 at 06:36:39PM +0100, Michael Janssen wrote:
> instead of this three lines:
> 
> >     databuffer = StringIO.StringIO()
> >     cPickle.dump(someData,databuffer)
> >     clientSock.send(databuffer.getvalue())
> 
> you can also use:
> 
>      clientSock.send(cPickle.dumps(someData))>
> 
> --> cPickle's dumps (and loads) produces (and reads from) strings
> directly.

cool. i'll try it


thanks and best wishes

-- 
Adrian Maier
(am@fx.ro)