SublimeREPL:Python - 运行当前文件 [英] SublimeREPL: Python - RUN Current File

查看:31
本文介绍了SublimeREPL:Python - 运行当前文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在选择当前在 SublimeText 中打开的 python 脚本:

With python script currently opened in SublimeText I'm choosing:

工具 > SublimeREPL > Python > 运行当前文件

Tools > SublimeREPL > Python > RUN Current File

Sublime 在一个新的 交互式 REPL[python] 窗口中执行脚本(这个窗口仍然在 Sublime 内部).

Sublime executes the script in a new interactive REPL[python] window (this window is still inside of Sublime).

python 脚本执行完成后 Sublime 类型:

After the python script execution is finished Sublime types:

回复已关闭

我现在可以在Repl Closed"消息下方的交互式窗口中输入 python 命令.但是当我按下 Enter 键时,编辑器只是在我希望它执行我刚刚输入的一行时前进到一个新行.请告知应该使用什么键(如果有)来运行键入的命令.

I now can start typing the python commands into this interactive window below "Repl Closed" message. But when I press an Enter key the editor simply advances to a new line when I expect it to Execute a line I just typed. Please advise what key (if any) should be used to run typed command.

推荐答案

首先进入Tools ->SublimeREPL ->蟒蛇->Python 来启动一个新的 Python REPL.然后,您可以使用 Tools -> 中的命令.SublimeREPL ->Eval in REPLTransfer to REPL 在运行的解释器中传输和/或评估你的代码片段.代码运行完毕后,REPL 保持打开状态,允许您按预期输入新命令.

First, go to Tools -> SublimeREPL -> Python -> Python to start a new Python REPL. You can then use the commands in Tools -> SublimeREPL -> Eval in REPL and Transfer to REPL to transfer and/or evaluate pieces of your code in the running interpreter. When that code is done running, the REPL stays open, allowing you to enter new commands as you'd expect.

这篇关于SublimeREPL:Python - 运行当前文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆