Python Forum
python-docx: preserve formatting when printing lines
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python-docx: preserve formatting when printing lines
#2
Line 28 will make p.text a str object because you use .join().
Got to keep it a docx object or will lose all formatting.
Tmagpy likes this post
Reply


Messages In This Thread
RE: python-docx: preserve formatting when printing lines - by snippsat - Jul-08-2022, 12:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 1,118 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Replace a text/word in docx file using Python Devan 4 3,986 Oct-17-2023, 06:03 PM
Last Post: Devan
  What are these python lines for? What are tey doing? Led_Zeppelin 7 1,717 Feb-13-2023, 03:08 PM
Last Post: deanhystad
  python-docx- change lowercase to bold, italic Tmagpy 0 1,483 Jul-01-2022, 07:25 AM
Last Post: Tmagpy
  python-docx regex : Browse the found words in turn from top to bottom Tmagpy 0 1,593 Jun-27-2022, 08:45 AM
Last Post: Tmagpy
  python-docx regex: replace any word in docx text Tmagpy 4 2,353 Jun-18-2022, 09:12 AM
Last Post: Tmagpy
  python seems to be skipping lines of code alansandbucket 1 4,263 Jun-22-2021, 01:18 AM
Last Post: Larz60+
  Сombine (Merge) word documents using python-docx Lancellot 1 11,748 May-12-2021, 11:07 AM
Last Post: toothedsword
  How to add run in paragraph using python-docx? toothedsword 0 2,844 May-12-2021, 10:55 AM
Last Post: toothedsword
  tabula-py, how to preserve a read_pdf() format and export to csv abcoelho 2 3,444 Mar-24-2021, 08:34 PM
Last Post: abcoelho

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020