How to display Python version in 'oh-my-zsh'

1.5k Views Asked by At

I am trying to display the python version next to my python venv using oh-my-zsh with powershell9k theme. Does anyone have any idea how?

I tried adding virtualenv --version under virtualenv in ~/.p10k.zsh but it didn't work as I imagined.

1

There are 1 best solutions below

2
J_H On

To obtain a SemVer version you can use something like this:

python --version | sed 's,Python ,,'