在我的终端,我输入$ which python3,输出

/opt/local/bin/python3

我想将Atom配置为运行Python3脚本.在我的Atom配置中

runner:
python: "/opt/local/bin/python3"

但是,如果我在名为filename.py的脚本中运行以下脚本,

import sys
print(sys.version)

我得到以下输出:

2.7.11 (default, Feb 18 2016, 22:00:44) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]

如何为Python3设置路径.要正确运行x脚本吗?我可以用另外一个包裹吗?

推荐答案

Go to the Atom's menu bar -> Packages -> Script -> Configure Script (Or, you can use the shortcut Shift+Ctrl+Alt+O)

然后在命令空间中键入python3.

Python-3.x相关问答推荐

无法使用Python slack 螺栓SDK读取在 slack 通道中收到的消息

在BaseHTTPRequestHandler中填充和返回列表

我没有';无法理解此TemplateDoesNotExist错误

Django 模型类方法使用错误的 `self`

Python-Django 设置 Pandas DataFrame 的多索引不会分组/合并最后一个索引

如何使用 Selenium Python 连续单击一个按钮直到另一个元素出现?

如何将多输入数据加载器传递给单输入模型

如何转置和 Pandas DataFrame 并命名新列?

如何使用 django rest 框架在 self forienkey 中删除多达 n 种类型的数据?

Jupyter Notebook 拒绝打印一些字符串

使用 pandas 数据帧映射到中转( node )点的跨容量请求

命名元组内命名元组的 Python 语法

如何在 Python 中计算 cohen 的 d?

如何将 SimpleGUI 与 Python 2.7 和 3.0 shell 集成

为什么`multiprocessing.Queue.get`这么慢?

如何制作函数Collection

混合全局/参数和名为top的函数的奇怪python行为

当 None 被传递时,如何将默认值应用于 python 数据类字段?

使用 asyncio 的多个循环

字典理解中的操作顺序