5

I found this question which explains what __pycache__ is and how to hide it on OSX and Windows.

I'm looking for an equivalent for Linux.

I already have it in my .gitignore for when I push it, but I often use tree to get an overview of my project directories, and it looks messy to see the __pycache__ directories everywhere.

Juicy
  • 11,840
  • 35
  • 123
  • 212
  • hide it or don't write it completely? – Dimitris Fasarakis Hilliard Aug 25 '16 at 15:35
  • @Jim I didn't know you could tell python to not write them at all. Ideally I would just like to not have them displayed in my directory listing. How would I prevent python from writing them completely? – Juicy Aug 25 '16 at 15:38
  • 2
    set `PYTHONDONTWRITEBYTECODE=1` in your `/etc/environment` file. If you're running from a IDE, it probably also offers a way to set default flags for python everytime it executes, you could add `-B` to that so it uses it every time. – Dimitris Fasarakis Hilliard Aug 25 '16 at 15:48

0 Answers0