badri
badri

Reputation: 617

How to print blinking text in python

colorama is a package which is universal and will work independent of the platform. But it doesn't seem to support blinking text. Any other way this can be achieved in python ?

Upvotes: 2

Views: 25700

Answers (2)

FiReTiTi
FiReTiTi

Reputation: 5878

You can simply use \033[5m in your print function:

print("\033[5mBlinking \033[0m Not Blinking")

\033[0m is used to reset, so to cancel the blinking, otherwise everything you write after \033[5m will be blinking.

Upvotes: 2

Kenneth Bruinsslot
Kenneth Bruinsslot

Reputation: 86

from termcolor import colored, cprint
cprint('\nJames Everleigh', 'red', attrs=['blink'])

cprint also allows bold, underlined, etc. and a small range of colors.

Upvotes: 7

Related Questions