PyCharm: Run recent open file, not previous one

Hi,

I use PyCharm and I have created a new file 3rd.py, while the previous one I used, 2nd.py, still remains open in the program.
I am now writing code in 3rd.py, then hitting shift/F10 to run this code and show it in the terminal.

What happens is, that 2nd.py is being run, although I am in 3rd.py now.

How can I assure that 3rd.py runs // that that file runs, which I am now at & have opened in the window?!

Any idea,

or am I doing something wrong here?

Thanks.

With my keymap configuration (XWin Proper Redo), SHIFT+F10 executes the current “Run configuration”, i.e. in most cases re-runs the last executed file, and CTRL+SHIFT+F10 runs the currently opened file. I think that’s the one you’re looking for !

1 Like

Yep, worked.

Again, big thanks :slight_smile: