How do I converted a null (0) terminated string to a Python string?
steve at holdenweb.com
Thu Sep 14 05:51:28 CEST 2006
> Hi All,
> I've received (via UDP) a null terminated string and need to convert it
> into a Python string. Can anyone tell me how this is done? If it helps,
> I know the number of characters in the string.
> M. McDonnell
Have you received this string in Python or in C? If the former, then
just throw away the last character of the string you've received and
s = s[:-1]
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
More information about the Python-list