Skip to content

Rich output from a Python CLI tool #42

Answered by pawamoy
NikosAlexandris asked this question in Q&A
Discussion options

You must be logged in to vote

It's probably because Rich detects its running in a subprocess and therefore deactivates colors. Try forcing them with this:

``` bash exec="true" result="ansi" source="material-block"
export FORCE_COLOR=1  # markdown-exec: hide
python printsomethingrich.py
```

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@NikosAlexandris
Comment options

@pawamoy
Comment options

@NikosAlexandris
Comment options

Answer selected by NikosAlexandris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants