How to write a string in a file ensuring that there is no nul byte character in a string in python?
f.write(x1+','+x2+','+x3)
How to write a string in a file ensuring that there is no nul byte character in a string in python?
f.write(x1+','+x2+','+x3)
Just replace '\x00'
your input string by an empty character.
In your example that would look like this :
data = x1+','+x2+','+x3
data = data.replace('\x00' , '')
f.write(data)