View Single Post
  #2  
Old 04-04-2011, 03:52 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you are manually placing the \n characters in your text file, then you will need to use the following code to manually escape special characters (e.g \n):
Code:
s = s.decode('string_escape')
Alternatively, you could use the textwrap module to automatically wrap the text:
Code:
import textwrap
s = '\n'.join(textwrap.wrap(s,100)) #Wrap every 100 characters
Reply With Quote