Writing an end of string character in Python
skip at pobox.com
Thu May 31 17:30:04 CEST 2001
Charlie> I read in PP2E that "\0" does not terminate the string in
Charlie> Python. Is there anyway I can force it to?
You can safely embed ASCII NUL characters in Python strings, so if you need
to write a string containing one, no problem:
s = "I'm a NUL-terminated string\000"
Skip Montanaro (skip at pobox.com)
More information about the Python-list