Created
July 13, 2012 14:44
-
-
Save zachaysan/3105264 to your computer and use it in GitHub Desktop.
Clean out distracting files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def clean(): | |
for root, dirs, files in os.walk(os.getcwd()): | |
for f in files: | |
p = os.path.join(root, f) | |
if p[-1] == "~" or p[-4:] == ".pyc": | |
os.remove(p) | |
if __name__ == '__main__': | |
clean() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment