Skip to content

Instantly share code, notes, and snippets.

@moylop260
Created August 19, 2014 18:19
Show Gist options
  • Save moylop260/0b814b881316e51c521a to your computer and use it in GitHub Desktop.
Save moylop260/0b814b881316e51c521a to your computer and use it in GitHub Desktop.
import os
path = '.'
for dirname, dirnames, filenames in os.walk(path):
# print path to all filenames with extension py.
for filename in filenames:
fname_path = os.path.join(dirname, filename)
fext = os.path.splitext(fname_path)[1]
if fext == '.py':
print fname_path
else:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment