I want to write "" to a file. Not a "tab character", but literally "".
How do I do this? It has been driving me crazy for more than an hour; everything I try produces an actual "tab character" (empty space).
Why would I want this? Because I'm generating a config file with a ConfigParser() which also includes some delimiters, and I want that file to be human-readable. I do not consider empty space readable.
EDIT: sorry, the problem was not clear: I want to do this for variables that contain strings. So writing "\t" is not an option. I must write the value of a variable containing an escaped character to a file in a manner ideologically equivalent to:
v = ""
write(v)
without changing the definition of v
(though operations on v
are OK)
It seems impossible to change v
into "\t" after it has been defined as "".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…