![]() ![]() Added the registry key was still necessary to get color shown. Please note that my Windows 1909 does not have the registry key you mention (and it's a user one, so for every user that logs on it might be different).Ī quick test of your code returns [35mThis is purple[0m and no color (so the registry entry is still necessary it seems). ![]() Mentioning that its default on in 1909 might improve the article. Please note I really like this post as it shows a very easy way for color without much additional coding I wasn't aware off. ![]() It's not the registry entry that creates an issue but making a registry change.īut being default in in Windows 1909 might help a bit although here I must also mention, again from personal experiences, that a lot of companies are not using it and maybe using older versions downto WinXP. Elevation is not something corporate employees are allowed to do. ![]() Maybe not on your own computer, but corporations tend to be not that happy with these kind of changes in my experiences over the last decades. To use a color, you need to write the ANSI color, your text and the ANSI color default. Negative(reverse the foreground and background) With this modification, you can compile the same program for Windows and Linux without changing anything before to color the text of the console on Python for Linux, you used the ESC code, on Windows you used a library, so you had to write the same program twice! Colors Color Reg add HKEY_CURRENT_USER\Console /v VirtualTerminalLevel /t REG_DWORD /d 0x00000000 /f ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |