2

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 ?

badri
  • 575
  • 2
  • 8
  • 22
  • 1
    Doesn't this help you: https://stackoverflow.com/questions/27533244/how-to-make-a-flashing-text-box-in-tkinter? There is also https://www.blog.pythonlibrary.org/2012/08/09/wxpython-how-to-make-flashing-text/, and it seems you can do it with pygame too. – Ando Jurai Aug 23 '17 at 09:05
  • Thanks Ando ! Using wxpython or pygame , i have to install these on several PC's which run this code so becomes a dependency for which i don't have permissions. The stackoverflow link https://stackoverflow.com/questions/27533244/how-to-make-a-flashing-text-box-in-tkinter provides info for flashing text box(opens a new one), but i have some text that is already getting printed and would like it to flash – badri Aug 24 '17 at 09:44

2 Answers2

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

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

1

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.

FiReTiTi
  • 5,597
  • 12
  • 30
  • 58