Set up Python 3 build system with Sublime Text 3

后端 未结 8 2182
青春惊慌失措
青春惊慌失措 2020-11-28 21:46

I want to configure Sublime Text 3 to build Python 3, but I don\'t seem to understand how the builds work. Many tutorials have told me to make a build file containing code s

8条回答
  •  悲&欢浪女
    2020-11-28 22:31

    The reason you're getting the error is that you have a Unix-style path to the python executable, when you're running Windows. Change /usr/bin/python3 to C:/Python32/python.exe (make sure you use the forward slashes / and not Windows-style back slashes \). Once you make this change, you should be all set.

    Also, you need to change the single quotes ' to double quotes " like so:

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

    The .sublime-build file needs to be valid JSON, which requires strings be wrapped in double quotes, not single.

提交回复
热议问题