Python 3 alias All In One

发布时间 2023-04-30 23:14:11作者: xgqfrms

Python 3 alias All In One

python3 / py3 / python

image

# $ vim .zshrc
$ code .zshrc

$ source ~/.zshrc
$ py3 --version
Python 3.9.6
$  python --version
Python 3.9.6
$  python3 --version
Python 3.9.6

$ which py3
py3: aliased to python3
$ which python
python: aliased to /usr/bin/python3
$ which python3
/usr/bin/python3

demos

.zshrc

# ...
# Python 3 ✅
alias python=/usr/bin/python3

# Python3
alias py3='python3'

# export PATH="/usr/bin/python3:$PATH"
# export PATH="/usr/bin/:$PATH"
# $ cd /usr/bin/ && ls | grep "python" ✅
# $ cd /usr/bin/ && ls -al | grep "python" ✅

# .bash_profile
source ~/.bash_profile

# end zsh
# source ~/.zshrc

(? 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

docs

https://www.python.org/doc/

Python 3.11.3 文档

https://docs.python.org/3/

https://docs.python.org/zh-cn/3/

https://www.runoob.com/python3/python3-tutorial.html

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 ?️,侵权必究⚠️!