samedi 23 juillet 2016

How to put lines from a text file into paragraphs with python-docx?

So I have a text file with lines of text. I want to iterate through each line and write each one to a paragraph for a Word Document. I've been trying to use python-docx, which is amazing so far, but putting the string into the add_paragraph function makes it output exactly what was copied, including newline code, square brackets, and quotes and all this other stuff.

Is there any way to get rid of this stuff and just send the text to the add_paragraph function?

Aucun commentaire:

Enregistrer un commentaire