mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
python.zsh to get the current python version
This commit is contained in:
parent
e273cf004e
commit
f6d4e6980c
1 changed files with 7 additions and 0 deletions
7
lib/python.zsh
Normal file
7
lib/python.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# get the python version
|
||||||
|
function python_prompt_info() {
|
||||||
|
local python_prompt
|
||||||
|
python_prompt=$(python -c 'import platform; print(platform.python_version())')
|
||||||
|
[[ "${python_prompt}x" == "x" ]] && return
|
||||||
|
echo "${ZSH_THEME_PYTHON_PROMPT_PREFIX}${python_prompt}${ZSH_THEME_PYTHON_PROMPT_SUFFIX}"
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue