Skip to content

Instantly share code, notes, and snippets.

@zachaysan
Created July 13, 2012 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachaysan/3105264 to your computer and use it in GitHub Desktop.
Save zachaysan/3105264 to your computer and use it in GitHub Desktop.
Clean out distracting files
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