sublime Text3 === 无法输入input的问题解决办法

 

sublimetext无法对input或者raw_input执行。因此搜了很多方法后,解决了这个问题:

1.先下载插件sublimerepl ,如果无法下载,请点击https://github.com/wuub/SublimeREPL下载后放在本地文件下:

2.下打开  ..Sublime Text 3DataPackagesSublimeREPLconfigPython目录下的Main.sublime-menu文件,找到"id": "repl_python"所在行,将这个JSON对象中args属性下cmd属性值改为["python", "-i", "-u", "$file_basename"],如图所示:

*你可以改为["python", "-i", "-u", "$file_basename"],我的电脑上有两个版本的python,所以我这里有个python3

3.重启sublimeTEXT,进行快捷键配置:

首选项->按键绑定-用户,然后在弹出的文件中输入:

 

 [
{
    "keys":["f5"],"command":"repl_open",
    "caption":"Python",
    "mnemonic":"p",
    "args":{
        "type":"subprocess",
        "encoding":"utf8",
        "cmd":["python3","-i", "-u", "$file"],
        "cwd":"$file_path",
        "syntax":"Packages/Python/Python.tmLanguage",
        "external_id":"python"
    }
}
]

 

ctrl+s保存,然后试运行代码"

a=input("a:")

如果成功,那么效果是这样的:

好了,解决了!

顺便提一下


如果你也喜欢Python 这里有一群Python爱好者汇集在此。

关注微信公众号:【软件测试技术】,回复 888,获取QQ群号。 

原文地址:https://www.cnblogs.com/botoo/p/7591666.html