Sockets

Skip Montanaro skip at pobox.com
Wed Oct 10 09:46:10 EDT 2001


    Hugo> The problem is that the Client received s1 and s2 in one only
    Hugo> string.  How can i received in 2 separeted variables ?

You need to provide some sort of delimiter between the two strings.  That
can be just about anything that doesn't occur in the strings.  It might be
easiest to just send the strings with newline terminators and then just use
readline() on the receiving end to get both strings.

To transmit more complex data, look at the pickle, cPickle and marshal
modules:

    http://www.python.org/doc/current/lib/module-cPickle.html
    http://www.python.org/doc/current/lib/module-pickle.html
    http://www.python.org/doc/current/lib/module-marshal.html

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list