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

yipeiwu_com6年前Python基础

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

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

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

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

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

[ 
{"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 输入换行不结束的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

pip install urllib2不能安装的解决方法

python35 urllib2 不能用 Could not find a version that satisfies the requirement urllib2 (from...

python使用win32com在百度空间插入html元素示例

复制代码 代码如下:from win32com.client import DispatchEximport timeie=DispatchEx("InternetExplorer.Ap...

Python+Pika+RabbitMQ环境部署及实现工作队列的实例教程

Python+Pika+RabbitMQ环境部署及实现工作队列的实例教程

rabbitmq中文翻译的话,主要还是mq字母上:Message Queue,即消息队列的意思。前面还有个rabbit单词,就是兔子的意思,和python语言叫python一样,老外还是...

深入理解python中的select模块

简介 Python中的select模块专注于I/O多路复用,提供了select  poll  epoll三个方法(其中后两个在Linux中可用,windows仅支持s...

Python实现截屏的函数

Python实现截屏的函数 # -*- coding: cp936 -*- import time,Image import os, win32gui, win32ui, win...