脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - Python - sublime python3 输入换行不结束的方法

sublime python3 输入换行不结束的方法

2021-02-02 00:34skytoby Python

下面小编就为大家分享一篇sublime python3 输入换行不结束的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

sublime编辑模式下,编译py文件,enter键后并没有打印,发现是sublime编译方式的问题,需要安装插件sublimerepl。

?
1
2
3
#!/usr/bin/python3
str = input("请输入: ")
print(str)

sublime python3 输入换行不结束的方法

安装完之后,点击tool--sublimerepl-- python-- python - run current file,就可以正常的编译,输入一行后打印

sublime python3 输入换行不结束的方法

由于每次编译都需要这步操作,会很麻烦,可以设置快捷键:

点击preferences--key bindings,设置快捷键,本次设置的是f5,可以自行修改

sublime python3 输入换行不结束的方法

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[
{"keys": ["f5"],"command": "repl_open",
"caption": "python - run current file",
"id": "repl_python_run",
"mnemonic": "r",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": ["python", "-u", "$file_basename"],
"cwd": "$file_path",
"syntax": "packages/python/python.tmlanguage",
"external_id": "python",
"extend_env": {"pythonioencoding": "utf-8"}
}
}
]

以上这篇sublime python3 输入换行不结束的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/cao861544325/article/details/79508525

延伸 · 阅读

精彩推荐