Python Forum
How can I write formatted (i.e. bold, italic, change font size, etc.) text to a file?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I write formatted (i.e. bold, italic, change font size, etc.) text to a file?
#4
(Jun-19-2018, 04:41 AM)JohnJSal Wrote: is there no built-in way to do these things?
This is the python way. I guess you refer to Standard Python Library. It is the core, there are thousands of third-party packages available through PyPi. And yet others that are not on PyPI.

(Jun-19-2018, 04:41 AM)JohnJSal Wrote: do you know if this works with .doc (not .docx) files
No, it's just for docx files. doc and docx are different formats. For doc files you will need to use pywin32 - Python extensions for Windows. It provides access to much of the Win32 API, the ability to create and use COM objects, and the Pythonwin environment.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: How can I write formatted (i.e. bold, italic, change font size, etc.) text to a file? - by buran - Jun-19-2018, 05:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write variable in a python file then import it in another python file? tatahuft 4 1,145 Jan-01-2025, 12:18 AM
Last Post: Skaperen
  [SOLVED] [Linux] Write file and change owner? Winfried 6 1,849 Oct-17-2024, 01:15 AM
Last Post: Winfried
  Print text with big font and style tomtom 6 21,377 Aug-13-2024, 07:26 AM
Last Post: yazistilleriio
  What does .flush do? How can I change this to write to the file? Pedroski55 3 1,552 Apr-22-2024, 01:15 PM
Last Post: snippsat
  Last record in file doesn't write to newline gonksoup 3 1,834 Jan-22-2024, 12:56 PM
Last Post: deanhystad
  Python code for alignment and font size 1418 0 1,039 Jan-14-2024, 03:56 AM
Last Post: 1418
  write to csv file problem jacksfrustration 11 5,839 Nov-09-2023, 01:56 PM
Last Post: deanhystad
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 4,216 Nov-09-2023, 10:56 AM
Last Post: mg24
  logging: change log file permission with RotatingFileHandler erg 0 2,720 Aug-09-2023, 01:24 PM
Last Post: erg
  How can I change the uuid name of a file to his original file? MaddoxMB 2 2,397 Jul-17-2023, 10:15 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

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