If I read a string that contains a newline character(s) into a variable, 
then write that variable to a file, how can I retain those newline 
characters so that the string remains on one line rather than spans 
multiple lines?

Example: In a CGI script, I'm reading the address field from an HTML 
form. Almost always the person will press ENTER so they can enter a 
second or third line. If I then want to write all the field values of 
this form to a CSV file, so that each person's entries takes one line, 
how can I ensure that the address string stays on one line despite the 
newline characters?

(Or is it better to just use separate text fields for each line of the 
address?)

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to