Search code examples
pythonpycharm

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?


Solution

  • 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