Re: escape character / csv module



V N wrote:
string "\x00" has a length of 1. When I use the csv module to write
that to a file

csv_f = csv.writer(file("test.csv","wb"),delimiter="|")
csv_f.writerow(["\x00","zz"])

The output file looks like this:
|zz

Is it possible to force the writer to write that string?

This will do what you want:

"\\x00"
.