如何在 PyCharm 中运行命令而不必运行整个脚本? [英] How do I run commands in PyCharm without having to run the whole script?

查看:77
本文介绍了如何在 PyCharm 中运行命令而不必运行整个脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有多个函数的 Python 脚本,我想运行不同的 ilocloc 命令来测试不同的东西.由于我是 PyCharm 的新手,我不熟悉它的不同功能.如何在不必运行整个 Python 脚本的情况下运行单个命令?

I have a Python script with several functions and would like to run different iloc and loc commands to test different things. Since I'm new to PyCharm, I'm not familiar with its different functionalities. How can I run single commands without having to run the whole Python script?

我认为它必须直接在 Python 控制台中.我试过了,还是不行.

I assume it has to be directly in the Python console. I tried, but it doesn't work.

推荐答案

PyCharm 有一个 Execute Line in Console 命令,其快捷方式是 ALT + SHIFT + E.如果配置正确,这将在 Python 控制台中运行选定的行.

PyCharm has an Execute Line in Console command, the shortcut for which is ALT + SHIFT + E. This will run the selected lines in the Python Console if you have it configured properly.

这篇关于如何在 PyCharm 中运行命令而不必运行整个脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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