"Marc 'BlackJack' Rintsch" <bj_666 at gmx.net> wrote in message news:pan.2006.09.14.15.36.07.509974 at gmx.net... > I would spell it: > > if strg.endswith('\0'): > strg = strg[:-1] I would just go with: strg = strg.rstrip('\0')