printing - Use Python to output bold text in .doc -


i trying print statement:

a= 'hi %s, \n meeting scheduled %s %sth \n if have  questions please contact %s' % (cfname, meetingmonth, meetingday, cleadfname) print 

i'm trying bold every variable insert (i.e. cfname, meetingmonth etc.). basically, have script asking enduser input writes statement .doc format. there simple way bold things when writing in python?

i've tried bold brackets around word , doesn't seem work. great!

print produces plain text, not microsoft word documents. if add html formatting tags (<html>, <body>, <strong>, <br />, etc.) necessary, give resulting text file .doc extension, open word, - assuming have reasonably recent version understands html - parse html , display result you're looking for.

sample:

a= '<html><head></head><body>hi %s, </br> meeting scheduled <strong>%s %sth</strong> <br /> if have  questions please contact %s</body></html>' % (cfname, meetingmonth, meetingday, cleadfname) 

Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -