我今天一直试图进入Python,我想使用Sublime text 3作为编辑器,但当我尝试做任何事情时,我只是得到了这个错误:
C:\python33\python.exe: can't find '__main__' module in ''
[Finished in 0.2s with exit code 1]
[cmd: ['C:\\python33\\python.exe', '-u', '']]
[dir: C:\Program Files\Sublime Text 3]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\ v1.0\;C:\Anaconda;C:\Anaconda\Scripts]
我的Python构建是:
{
"cmd": ["C:\\python33\\python.exe", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "utf8",
"path": "C:\\Python33\\"
}
有人能帮我找到错误吗?
答案 0 :(得分:0)
这不是ST3的错误,而是您的Python脚本。尝试将脚本中的主类更改为:
name = __main__: