Python does not treat NUL bytes as something special; they are no different from spaces or commas. So split() works fine:
>>> my_string = "Health\x00experience\x00charactername\x00" >>> my_string.split('\x00') ['Health', 'experience', 'charactername', '']
Note that split treats \x00 as a delimiter, not as a terminator, so at the end we get an extra blank line. If this is a problem, you can simply cut it off:
>>> my_string.split('\x00')[:-1] ['Health', 'experience', 'charactername']
source share