我按照https://www.jianshu.com/p/b4ccf43118b9中的说明安装了SublimeREPL,但是无法运行input程序,输入后按回车键没反应:
我的代码:
a = input("sss:");
b = int(a);
if b >= 20 :
print("big");
else :
print("small");
print("sb");
print("big");
我试过将main.sublime-menu中的python改为C:\Python35\python(我python的路径),这是我改以后的main.sublime-menu:
[
{
"id": "tools",
"children":
[{
"caption": "SublimeREPL",
"mnemonic": "R",
"id": "SublimeREPL",
"children":
[
{"caption": "Python",
"id": "Python",
"children":[
{"command": "repl_open",
"caption": "Python",
"id": "repl_python",
"mnemonic": "P",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Python35\\python", "-i", "-u"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "python_virtualenv_repl",
"id": "python_virtualenv_repl",
"caption": "Python - virtualenv"},
{"command": "repl_open",
"caption": "Python - PDB current file",
"id": "repl_python_pdb",
"mnemonic": "D",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Python35\\python", "-i", "-u", "-m", "pdb", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "repl_open",
"caption": "Python - RUN current file",
"id": "repl_python_run",
"mnemonic": "R",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["C:\\Python35\\python", "-u", "$file_basename"],
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {"PYTHONIOENCODING": "utf-8"}
}
},
{"command": "repl_open",
"caption": "Python - IPython",
"id": "repl_python_ipython",
"mnemonic": "I",
"args": {
"type": "subprocess",
"encoding": "utf8",
"autocomplete_server": true,
"cmd": {
"osx": ["C:\\Python35\\python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
"linux": ["C:\\Python35\\python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"],
"windows": ["C:\\Python35\\python", "-u", "${packages}/SublimeREPL/config/Python/ipy_repl.py"]
},
"cwd": "$file_path",
"syntax": "Packages/Python/Python.tmLanguage",
"external_id": "python",
"extend_env": {
"PYTHONIOENCODING": "utf-8",
"SUBLIMEREPL_EDITOR": "$editor"
}
}
}
]}
]
}]
}
]
另外,我的python版本为Python3.11.0,没有将Python添加到环境变量PATH中。
我的sublime text版本为sublime text4.1.4.3
我只是个12岁小孩,请求支援!请求回复!