0

This may seem trivial, and I admit that it is more a question relating to ease of access in VS Code.

My VS Code window shows "NO FOLDER OPENED". How do I fix this?

Up until the other day when I set VS Code as my default app for .py files (this is the problem), I could see any and all folders, sub-folders, and .py/.ipynb files on my Explorer tab. I am both new to Python and VS Code. I have tried these things to fix my problem:

  • Attempted to reset to all of microsoft's default app associations--the aforementioned files still open with VS Code.
  • Attempted to change each file's "Open with:" path (by accessing its properties)--it gives no other option, since PowerShell and CMD are not "apps".
  • Found this that got close but did not target my specific problem.
  • Found another article which refers to Windows 7--I didn't read it after seeing this.

I have done various other things, but I think you get the point; I'm at a loss!

This problem seems annoyingly easy to fix. I would rather see if there is some type of setting, in VS Code or Windows, that I am overlooking before searching for a complex work-around.

I'm also new to Stack overflow. I hope this is a "valid" question.

nickgrayy
  • 11
  • 2

2 Answers2

1

It's important to keep things organized even when you are new to coding. In VScode it is pretty simple to do that. I suggest you to make a folder for your projects and also for other purposes like practicing on examples.

Lets say you created a folder on desktop named Python, and you keep all your .py files in there, then you don't have to open each of the python files by double clicking it, it's a wrong practice. Instead, open VScode application from the start menu or desktop, then go to file > open folder > Python(the python folder you can create on your desktop). This way it opens a workspace(Folder) where you can work with different Python files or any other files.enter image description here

  • @nickgrayy alright, what I was trying to say is that the default for opening .py files is not VScode, it's python IDLE which you would have installed while installing python. So if nothing works try reinstalling python from python.org. Because I think maybe changing the default app is the cause of your issues. –  Jul 28 '21 at 02:58
  • Right. Yes I remember attempting, at first, to click directly on the files. All I had to do was open a file... whoops. – nickgrayy Jul 28 '21 at 03:00
0

With Ctrl key pressed, press O and then K. Then, select the folder where your python file is located.

raunasur
  • 128
  • 11
  • Thanks for your help! I just opened a folder, and that fixed my problem. I knew it was something obvious.... but of course I overlooked it. – nickgrayy Jul 28 '21 at 02:54