How do I converted a null (0) terminated string to a Python string?

Fredrik Lundh fredrik at pythonware.com
Thu Sep 14 03:17:32 EDT 2006


Michael wrote:

> Thanks for your reply. Just wondering... how are Python strings
> formatted? Evidently they're not 0 terminated.

have you tried *printing* the thing you got via UDP?

to get a programmer-friendly representation of an arbitrary object, use

     print repr(obj)

(where obj is your string, in this case).

</F>




More information about the Python-list mailing list