Skip to content

Instantly share code, notes, and snippets.

@offby1
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save offby1/5b0c0d32ab167de0f113 to your computer and use it in GitHub Desktop.
Save offby1/5b0c0d32ab167de0f113 to your computer and use it in GitHub Desktop.
import os
# The top argument for walk
topdir = '/Users/erichanchrow'
os.chdir(topdir)
# The extension to search for
exten = ('.rpm', '.srpm', '.dmg')
files = ();
for dirpath, dirnames, files in os.walk('.'):
for name in files:
if name.lower().endswith(exten):
print(os.path.join(dirpath, name).split('/'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment