Eric Jacoboni wrote:
> But :
>>     nom = nomz.rstrip('\0')
> 
> doesn't work for me:
> 
>>>> nomz
> 'Dupont\x00\x80\xbf\xff\xf70\x8f\xe0u\xa4\x00\x00.8\xfe\xfe\xfe\xff\x80\x80\x80\x80'
> 
>>>> nom = nomz.rstrip('\0')
>>>> nom
> 'Dupont\x00\x80\xbf\xff\xf70\x8f\xe0u\xa4\x00\x00.8\xfe\xfe\xfe\xff\x80\x80\x80\x80'

Sorry, I thought you had NUL-filled data.
For NUL terminated data:
     nom = nomz[: nomz.index('\0')]

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to