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 中创建运行当前文件的运行配置?


基础教程推荐
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 包装空间模型 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01