![]() Print("GColor:") # Gnome terminal supported Print(Formatting.Bold,"This is a test!", Formatting.Reset) Print(ANSI_Compatible.Color(120),"This is a test!", ANSI_Compatible.END) Print(Base.FAIL,"This is a test!", Base.END) ![]() # If Foreground is False that means color effect on Backgroundĭef Color(ColorNo, Foreground=True): # 0 - 255 Print(Color.B_DarkGray + Color.F_LightBlue + "This is a " + Formatting.Bold + "test" + Formatting.Reset_Bold + "!" + Base.END) All classes worked very good except GColor ( RGB), that, it is usable in graphical terminal like Linux Mint terminal.Īlso, you can use these classes like this: print(Formatting.Italic + ANSI_Compatible.Color(12) + "This is a " + Formatting.Bold + "test" + Formatting.Reset_Bold + "!" + ANSI_Compatible.END + Formatting.Reset) I've tested these classes on Ubuntu Server 16.04 and Linux Mint 18.2. ![]() Put these classes into Color.py file near your test.py file and run test.py.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |