python - 所有这些 python* 可执行文件是怎么回事?
问题描述
虽然我使用的是安装了 MacPorts 的 Mac,但我想这个问题可以应用于其他平台。
当我在 $PATH 中列出所有带有“python”前缀的可执行文件时,我得到了一堆结果:
//64-bit Mac Mini @work/
$ IFS=:
//64-bit Mac Mini @work/
$ find $PATH -name python\*
/opt/local/bin/python3
/opt/local/bin/python3m-config
/opt/local/bin/python3.7-config
/opt/local/bin/python2.7-config
/opt/local/bin/python3.7m
/opt/local/bin/pythonw2.7
/opt/local/bin/python3.7m-config
/opt/local/bin/python3.7
/opt/local/bin/python3-config
/opt/local/bin/python2.7
/opt/local/bin/python3m
/usr/bin/python
/usr/bin/pythonw
/usr/bin/python2.7-config
/usr/bin/pythonw2.7
/usr/bin/python-config
/usr/bin/python2.7
我知道 python[23]* 是什么,但是 python3.7m、python3m、pythonw、pythonw2.7 和那些 python*-config 是做什么的?
更新
感谢您指出可能重复的评论。然而,这并没有完全解决我的问题,因为它没有提到 python2.7 解释器上的“w”标志,也没有提到这些 *-config 程序的功能是什么。
解决方案
后缀字母表示 CPython 实现的具体构建的“ABI 版本”,可以看一下这个 GitHub 提交
至于 2.x 版本中的 'w' 标志,在手册页中都有解释:
pythonw -- 运行允许 GUI 的 python 脚本
...
实际上,从 Python 2.5 开始,普通的 python 也允许 GUI 访问,所以现在 python 和 pythonw 是可以互换的。
python*-config 程序用于构建使用 python 的程序,它有点像“pkg-config”应用程序,专门用于 python。
推荐阅读
- keras - 多类数据的混淆矩阵
- amazon-dynamodb - dynamodb 本地,重复键
- swiftui - 如何在 ScrollView 内的 SwiftUI 中创建网格视图?
- javascript - 包含级别的元素数量
- python - 如何计算 AKS 的最佳副本数
- matlab - 如何在多级单元格中找到匹配的元素(数字或字符串)?
- excel - 在 Excel for Web 中使用 OfficeScripts 计算 NumberFormat 中的空格
- go - Golang为什么结果不等于1000?
- math - 用逗号将十进制转换为二进制
- python-3.x - 熊猫插值给出奇怪的结果