0

我正在尝试让 SublimeText3 在 Ubuntu 18.04 上使用 Python 3 构建。我在我的 Ubuntu 机器上安装了 python 3.6.6,但是当我按下 ctrl+b 时,Sublime 默认为 Python 2。当我使用“build with”选项进行搜索时,没有可用的 Python 3 选项。

我需要做什么才能在我的 SublimeText3 项目构建中选择使用 Python 3?

4

1 回答 1

0

工具 -> 构建系统 -> 新构建系统

{
    "cmd": ["python3", "-u", "$file"],
    "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
    "selector": "source.python"
}

用名称 python3 保存它

转到工具 -> 构建系统 -> 并检查 python3

尝试使用以下方法对其进行测试:

import sys
print(sys.version)

按:Ctrl + b

来源:https ://gist.github.com/zaemiel/4fbd8b5125fda7a140be

于 2018-11-19T00:45:17.283 回答