【问题标题】:What is the difference between the python and python3 commands in unix-like systems?类 unix 系统中的 python 和 python3 命令有什么区别?
【发布时间】:2020-08-14 16:25:03
【问题描述】:

我阅读了每个命令的描述,但是每个命令的描述完全相同,所以我不明白这两个命令在类 Unix 系统中的工作方式有何不同。

谁能解释一下区别?

【问题讨论】:

  • 你用的是什么 disto?它们实际上是指向特定版本命令的符号链接。您可以执行which pythonwhich python3,然后查看该文件夹中的值以查看。
  • @DaveStSomeWhere 抱歉不明白 disto 是什么。不是只是显示文件目录吗?

标签: python python-3.x unix command


【解决方案1】:

引入 Python3 命令是因为 python 命令指向 python2。从那时起,Python3 已成为默认值,因此 python 在大多数但不是所有系统上都指向 python3。因此,大多数开发人员明确使用 python2 和 python3,以免在其他系统上遇到问题。

【讨论】:

  • 那么它们代表的只是python的不同版本?
  • 是的,不仅如此,它还可以保护许多发行版中的旧版 Python 2 应用程序在使用 Python 3 解释器调用时不被破坏。
猜你喜欢
  • 1970-01-01
  • 2022-01-21
  • 2013-07-31
  • 2013-11-30
  • 2019-01-28
  • 1970-01-01
  • 2011-03-19
  • 2016-10-03
  • 1970-01-01
相关资源
最近更新 更多