Vqid
Vqid

Reputation: 65

How to make a Run Configuration that runs current file in 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?

Upvotes: 3

Views: 3379

Answers (2)

Mat
Mat

Reputation: 33

In the upper right corner of the Pycharm window, left from the green "Run" button, click on the small triangle pointing downward to open the drop-down menu and select "edit configuration":

In the configuration window, all default run configurations are listed on the left. Delete all unnecessary run configurations and "current file" will remain as the default.

Run configuration screenshot

Upvotes: 0

bad_coder
bad_coder

Reputation: 12940

Simply right-click or press Ctrl + Shift +F10 inside the editor with the module open, see Run without any previous configuring.

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.

image of settings

Upvotes: 2

Related Questions