为什么在Python 3中打印字符串时会收到语法错误?
>>> print "hello World"
File "<stdin>", line 1
print "hello World"
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud) 我目前正在为我的项目使用Anaconda python发行版(不是anaconda插件,它们具有相同的名称,但我使用的包括Numpy,IPython等等.这有点令人困惑).所以我想将默认的python(v3.3)更改为Anaconda(v2.7.6)中的那个,在这种情况下,我将能够使用Anaconda中嵌入的库.我试图在Tool> Build System> New Build System下添加一个新脚本.
{
"path": "/home/username/anaconda/bin",
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Run Code Online (Sandbox Code Playgroud)
但它失败了,崇高仍在使用默认解释器:
>>>print (sys.version)
3.3.0 (default, Jun 12 2013, 17:01:35)
[GCC 4.7.2]
>>> print (sys.executable)
python3
>>> print (sys.path)
['/opt/sublime_text', '/opt/sublime_text/python3.3.zip', '/home/username/.config/sublime-text-3/Packages']
Run Code Online (Sandbox Code Playgroud)
所以我的问题很简单(但对于一个不知道的人来说已经够了):如何将这个默认的python解释器更改为我想要的那个;