python - 在同一台机器上运行 Python 3.2 和 2.7

标签 python macos python-2.7

有没有一种简单的方法可以在 OS X 机器上运行 Python 2.7 和 3.2?我一直在使用 IDLE 和 Python 3.2,并且有许多使用 Python 3 编写的程序,所以我真的不想卸载 3。但是,我正在做一个使用 2.7 作为其大部分基本代码的作业,所以我希望能够运行 2.7。

最佳答案

OS X 10.7 和 10.8 预装了 Python 2.7; /usr/bin/python:

$ /usr/bin/python2.7
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

但是,并不禁止安装其他版本的 python; Python for Mac 2.7.3安装程序不会干扰系统安装您的 Python 3 安装。

关于python - 在同一台机器上运行 Python 3.2 和 2.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12572156/

相关文章:

python - findAll中的匿名函数有什么用?

python - Matplotlib 和 Latex Beamer : Correct size

swift - 带页眉和页脚的 NSCollectionView

linux - Mac 与 Linux 中的可打印字符

python - 灯泡:用 get_or_create() 替换 create()

python - 在 webdriver 中对 Firefox 与 Chrome 的内存消耗进行基准测试

macos - Zsh 制表符补全 "cd .."

Python 2.7 cx_freeze : What are the risks of removing the encodings that I dont need?

python - 为什么 'the' 在 .remove 之后仍然存在?

python - 重新打开文件以进行追加