在 PyCharm 中运行一行代码 [英] Running a single line of code in PyCharm

查看:479
本文介绍了在 PyCharm 中运行一行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自 RStudio,所以请原谅我的天真.

在 RStudio 中,只需在行上按 Ctrl+Enter 即可运行行真是太好了.这会将代码行直接发送到控制台,这使得构建函数变得非常容易,因为您可以通过每一行来检查问题.但是,在 Pycharm 中,这似乎不是一个功能;相反,您用鼠标选择并运行代码(https://www.jetbrains.com/help/pycharm/loading-code-from-editor-into-console.html).

这似乎是一种很麻烦的代码编写方式.有没有办法像在 RStudio 中一样运行类似的代码?

解决方案

ALT+SHIFT+E 会在控制台执行.>

CTRL+SHIFT+A 会让你搜索热键.

I'm coming from RStudio, so forgive my naievete.

In RStudio it's really nice to be able to run lines by simply pressing Ctrl+Enter on the line. This sends the line of code directly to the console, which makes building functions really easy because you can work through each line to check for problems. However, in Pycharm this doesn't appear to be a feature; instead, you select with a mouse and run code (https://www.jetbrains.com/help/pycharm/loading-code-from-editor-into-console.html).

This seems like a cumbersome way to write code. Is there a way to run a single like of code like in RStudio?

解决方案

ALT+SHIFT+E will execute in console.

CTRL+SHIFT+A will let you search for hotkeys.

这篇关于在 PyCharm 中运行一行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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