python.zsh to get the current python version

This commit is contained in:
Grant Stephens 2017-12-03 06:55:04 +00:00 committed by GitHub
parent e273cf004e
commit f6d4e6980c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
lib/python.zsh Normal file
View 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}"
}