在实际工作和编码中,经常要在Python2和Python3进行切换,对于大部分初学者而言,sublime足够满足日常需要,设置方法如下(以已安装Python2为例):

新建python的编译系统:

sublime工具栏上,点击工具->编译系统->新编译系统

复制粘贴以下代码粘贴,(C:/Python3/python3.exe)是我的安装目录

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

保存为python3.sublime-build

 

重启sublime text就可以在工具->编译系统里面看见新建的python3这个个新的编译系统!

需要的时候,在编译系统中切换就可以!

sublime同时使用Python2和Python3

相关文章:

  • 2021-05-29
  • 2021-11-29
  • 2021-12-21
  • 2021-05-22
  • 2022-02-23
  • 2021-12-23
  • 2021-09-05
  • 2021-04-21
猜你喜欢
  • 2021-12-18
  • 2021-12-01
  • 2022-02-23
  • 2021-11-05
  • 2018-01-17
  • 2021-09-25
  • 2021-12-05
相关资源
相似解决方案