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

George Sakkis george.sakkis at
Fri Sep 15 22:03:21 CEST 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')]


More information about the Python-list mailing list