I need to write one line of formatted text to a *.rtf
file with Python. If I tried to print this line, here is how I would do it in Python:
print Kelvin of %s sensor at C is %s K, recorded with command p -V2 bery.org. % (MAC,210)
However, I need to write this single line to a file using formatted output placeholder %s
.
When writing this line to a file:
- I need the word MAC to be printed in the
Consolas
font. - I need all other text on the line to be printed in
Arial
font.
Is this possible with Python (on Windows)?