Skip to main content


Python bold string | Python bold text | Bold python print

python bold string, python bold text, bold python print, python bold, python bold text in email, python bold print, python bold text in string, python bold output, python bold text matplotlib, python bold titile, python string bold italic, python f string bold

Hello everyone,
As the topic suggest we are going to create python output that would be simple output in an bold form itself inside python shell.

Install pip install prompt-toolkit first
Lets get on with the code:-

#pip install prompt-toolkit

>>> from __future__ import unicode_literals, print_function
>>> from prompt_toolkit import print_formatted_text, HTML

>>> string = "Hello World Welcome to Python 4 Fun"

>>> print_formatted_text(HTML(f'<b>{string}</b>'))
Hello World Welcome to Python 4 Fun

I have tried all types method to make the output Bold.

But this method only works only on Windows in Python Shell.

Python bold string

But in Python IDLE the same code will throw an error

Python bold string

So how to run this?

Simple, Create PY file as bold.py and from CMD run it as python "bold.py".

Run > CMD > python "bold.py"


You can also run as batch file.

i.e. open Notepad > python "bold.py" (Type & save it as Runpy.bat)

Double click on the Runpy.bat file and it will work but for a split second.

To stop it from disappearing add pause 

This is how a batch file should look like

== Runpy.bat =================

@echo off

python "bold.py"

pause

===========================

Hope you like the tutorial.

Python is simple and fun to play with and yet very powerful. 🔥

Comments



🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)

Top 11 Essential Python Tips and Tricks





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram