String problem

Occean tritran2001 at iprimus.com.au
Sat May 25 16:51:05 EDT 2002


Assume that you have an text article. 
"Paint my love, you should paint my love
  It's a picture of thousand sunset 
  
  It's a freedom of , a thousand doves
  ......"

you have to read the article into a
string called str and use that string to pass into the function called
display(str). This function will display the exact content of the article back
into the screen. The problem is when you read the article in the string 
you have to put "\n\" at the end of each line in order to let the system
know the new line. For example:
str = ' Paint my love, you should paint my love\n\
  	  It's a picture of thousand sunset \n\
  	  \n\
          It's a freedom of , a thousand doves\n\'

I Just wondering are there another to do that without insert  "\n\" into
the end of each line.



More information about the Python-list mailing list