Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to hide files with a certain extension? I'm using Windows Vista and don't want to see pyc files in the Windows file explorer. It would be nice to reduce the clutter. Thanks

share|improve this question

migrated from Dec 14 '12 at 5:29

This question came from our site for professional and enthusiast programmers.

It's very easy, and not depend on your python file or not.

Open command prompt, type the disk letter that you want to hide all pyc file. For example, type D:. and you will see command prompt will move to D drive.

After that, type this line:

attrib +h *.pyc /s

if you want to view again those file:

attrib -h *.pyc /s

if you don't want to hide all pyc file in all drive, after you move to one drive, you can use cd command to move into folder you like and type above command. For example:

cd Project/Python Project/Toy Project

You can replace pyc in above command with any file type you want. And, you must turn off "Show hidden file and folder" in Folder Option. If not, I'm pretty sure that no trick will help you.

Hope this help :)

share|improve this answer

I stick this in my main python project file

import os
os.system('attrib +H *.pyc /S') 

That hides the complied files everytime I run it and the directory stays nice and clean

share|improve this answer

You must log in to answer this question.