def escape2null(text):
 parts = []
 start = 0
 while 1:
  found = text.find('\\', start)
  if (found == (-1)):
   parts.append(text[start:])
   return ''.join(parts)
  parts.append(text[start:found])
  parts.append(('\x00' + text[(found + 1):(found + 2)]))
  start = (found + 2)

def escape2null ( text ) : parts = [ ] start = 0 while 1 : found = text . find ( '\\' , start ) if ( found == ( - 1 ) ) : parts . append ( text [ start : ] ) return '' . join ( parts ) parts . append ( text [ start : found ] ) parts . append ( ( '\x00' + text [ ( found + 1 ) : ( found + 2 ) ] ) ) start = ( found + 2 )
return a string with escape-backslashes converted to nulls .