If you’ve been working on Python projects in VS Code, you will notice that __pycache__ folders appear within your project directory and they result in a lot of visual clutter. This post will walk you through getting a little bit more zen back into your editor by freeing up visual real-estate so you don’t need to look at it ever again!
Open Settings UI
In VS Code, open your settings via one of the following methods:
- Code > Preferences > Settings
- Cmd+Shift+P > Preferences > Open User Settings
Search for files.exclude
Click on Add Pattern and type in **/__pycache__
in the Exclude Pattern box and click OK.
Open Settings (JSON)
If you’d prefer to edit a JSON file, open your preferences by entering Cmd+Shift+P > Preferences: Open Settings (JSON).
Find the entry for “files.exclude” and add the following entry:
**/__pycache__": true
At the end, your settings should look like this:
"files.exclude": {
"**/__pycache__": true
}