Cant Print out the colors in Powershell Or CMD Terminal
See original GitHub issueWhat happened:
howdoi cant print out colors in Powershell Or CMD terminal in color mode.
> howdoi -c how to extend a list in python --explain
INFO: Version: 2.0.19
INFO: Fetching answers for query: how to extend a list in python
INFO: Using cached links
INFO: Links from stackoverflow.com found on google: 1
INFO: URL: https://stackoverflow.com/questions/252703/what-is-the-difference-between-pythons-list-methods-append-and-extend
INFO: Answers requested: 1, Starting at position: 1
INFO: Total answers returned: 1
>>> x = [[94m1[39;49;00m, [94m2[39;49;00m, [94m3[39;49;00m]
>>> x.append([[94m4[39;49;00m, [94m5[39;49;00m])
>>> [96mprint[39;49;00m(x)
[[94m1[39;49;00m, [94m2[39;49;00m, [94m3[39;49;00m, [[94m4[39;49;00m, [94m5[39;49;00m]]
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Cannot print colored text on Windows - python - Stack Overflow
this solution works in cmd, powershell #first import os import os # make printing colors possible os.system('') # get an amzing reuslt :D ......
Read more >Change text color in Windows PowerShell #5070 - GitHub
First, start the Windows PowerShell command prompt; Now run the CMD ... cmd exits; powershell starts printing text in "active" color a ......
Read more >Windows 11 command prompt printing characters instead of ...
To make my output coloured I used the module colorama ( v0.4.4 ), but it only contains constants (which are the characters which...
Read more >Write-Host (Microsoft.PowerShell.Utility)
The Write-Host cmdlet's primary purpose is to produce for-(host)-display-only output, such as printing colored text like when prompting the user for input ...
Read more >How to Change PowerShell Color Scheme on Windows 10
Once the Windows PowerShell 'Properties' box pops up, click on the 'Colors' tab, and you'll get a whole host of choices to set...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah I see, you use colorama together with rich and it monitors
stdout
, rewriting the colors as necessary.@V2dha would you mind giving that a try on your branch and seeing if the Windows colors look correct? @SepehrRasouli can help test as well.
That’s interesting. I haven’t done too much testing with Windows and colorization. We use
pygments
to do the highlighting currently.Would you mind checking out this branch and seeing if that works any better? It uses the
rich
library and perhaps they have figured out how to work with Powershell.https://github.com/gleitz/howdoi/pull/443
Then run
python -m howdoi -c how to extend a list in python --explain
. Here’s what I see: