Document creation with odfpy

DarkBlue pict100 at
Fri Jul 20 17:31:19 CEST 2007


I hope here is the right place to ask this:

I use the python odfpy library to create and
load an  odt file , however, spaces
in the passed in text are removed.


from odf.opendocument import OpenDocumentText
from import Style, TextProperties
from odf.text import H, P, Span

def SaveIt(MYTEXT) :
      doc = OpenDocumentText()
      for line in MYTEXT:
		p = P(text=line)

MYTEXT is a list containing lines from a wx.TextCtrl
if a line is:

abcabc          abcabc         abcabc

the result in the odt file looks like:

abcabc abcabc abcabc

Is there anything I am doing wrong ?


More information about the Python-list mailing list