SublimiteText3是在Python2中构建的,但我想使用Python3。如何更改版本(Ubuntu18.04)?

2024-09-30 16:31:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图让SublimiteText3在Ubuntu18.04上使用Python3构建。我的Ubuntu机器上安装了Python3.6.6,但当我按下ctrl+b时,升华默认为Python2。当我使用“buildwith”选项进行搜索时,没有Python3选项可用

要在SublimiteText3项目构建中使用Python 3,我必须做些什么?


Tags: 项目机器ubuntu选项python3ctrlpython2正试图
1条回答
网友
1楼 · 发布于 2024-09-30 16:31:44

Tools -> Build System -> New Build System

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

用python3这个名字保存它

Go to Tools -> Build system -> and check python3

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

import sys
print(sys.version)

按:Ctrl+b

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

相关问题 更多 >