How to make a Run Configuration that runs current file in PyCharm?(如何在 PyCharm 中创建运行当前文件的运行配置?)
问题描述
现在,每次我启动一个新的 Python 文件时,我都必须在 PyCharm 中进行新的运行配置才能运行它.有没有办法让默认配置只运行您正在查看的任何文件?还是我只需要为每个文件创建一个新配置?
Right now, every time I start a new Python file, I have to make a new run configuration in PyCharm in order to run it. Is there a way to have a default configuration that just runs whatever file you are looking at? Or do I just have to make a new config for each file?
推荐答案
在打开模块的编辑器中直接右键单击或按Ctrl + Shift +F10,见在没有任何先前配置的情况下运行.
Simply right-click or press Ctrl + Shift +F10 inside the editor with the module open, see Run without any previous configuring.
IDE 将为您创建一个临时运行配置,该配置使用 File > Settings > 项目 > Python解释器,见在项目设置中更改 Python 解释器.
The IDE will create a temporary run configuration for you that uses the project set in File > Settings > Project > Python Interpreter, see Changing the Python interpreter in the project settings.
这篇关于如何在 PyCharm 中创建运行当前文件的运行配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 PyCharm 中创建运行当前文件的运行配置?
基础教程推荐
- 对多索引数据帧的列进行排序 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
