如何制作运行当前文件 PyCharm 的运行配置 [英] How to Make a Run Configuration That Runs Current File PyCharm

查看:46
本文介绍了如何制作运行当前文件 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 > Project > 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 的运行配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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