Sublime REPL 配置 Python版本
安装Sublime REPL后默认使用系统的Python版本。查看方法,打开Sublime,在菜单栏:Tool->SublimeREPL->Python->Python
Python 2.7.10 (default, Oct 6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
如果Sublime REPL使用的是Python 2.7版本,有中文字符时运行Sublime REPL也会出现:
SyntaxError: Non-ASCII character '\xe6' in file test.py on line 211, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
***Repl Closed***
配置 Python版本为 Python 3.7.0
Sublime Text -> Preferences -> Browse Packages...
找到SublimeREPL,进入config/Python/目录,打开Main.sublime-menu,
将"cmd":下的"python"全部改为"python3"。