recently I've ran into this issue where I would open a .py file that used to run fine, I would click run code and nothing would happen at all. when I open the folder that contains the file and run the code, the python terminal runs fine without any problems, so without opening a folder, I can't run the python terminal in VScode at all.
I searched a lot and all I found was to uninstall and reinstall with deleting the .vscode folder (clean reinstall).
after reinstalling yes it runs fine, but if I open a folder, close it and try to open a single file it doesn't run the python terminal at all again.
kept trying and asking, the solution was to close the workspace: File > close workspace. very simple solution, I didn't know about it cause I'm a beginner, and I wanted to leave this somewhere so no one spends time in frustration and having to reinstall VScode multiple times like I did, beginners issues haha.
To simplify: tried running a python files, the python terminal doesn't run at all. solution is to close the work space, File > close workspace.
vscodehas alaunch.jsonfile in the folder which tells it how to behave when you clickrunor pressF5.i usually set the contents of mine to this:
The everything in the folder and subfolder will works as expected.
You can see my python config here (you probably only need the
integratedTerminalone). I also have a couple of nodejs configs setup too which you can use.The reason that i write this answer is that i always get a similar issue whenever setting up a new environment.