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

George Sakkis george.sakkis at gmail.com
Fri Sep 15 16:03:21 EDT 2006


Michael wrote:

> Robert,
>
> Thanks to you and everyone else for the help. The "s.split('\x00',
> 1)[0] " solved the problem.

And a probably faster version: s[:s.index('\x00')]

George




More information about the Python-list mailing list