-1

i just want to write a string to a text file with part of this one in bold.

Is there any way to do it?

An example of what i am asking for:

2021/02/19: this is an example

andyio
  • 129
  • 1
  • 6

2 Answers2

0

You cannot use any type of markdown in a .txt file, using python or not. You might want to check other files extensions such as .md files.

Gugu72
  • 2,052
  • 13
  • 35
0
test = 'teste.rtf'
out_file = open(test,'w')
out_file.write("""{\\rtf1
This is \\b Bold  \\b0\line\
}""")
out_file.close()
Gusman
  • 37
  • 9