Skip to content

Instantly share code, notes, and snippets.

@pcote
Last active February 4, 2016 23:49
Show Gist options
  • Select an option

  • Save pcote/5fe3eeb77aad9a61ba3a to your computer and use it in GitHub Desktop.

Select an option

Save pcote/5fe3eeb77aad9a61ba3a to your computer and use it in GitHub Desktop.
import os
def pyfiles():
base_dir = "/home/username/blender-2.76b-linux-glibc211-x86_64/2.76/scripts"
for dir_name, child_dirs, files in os.walk(base_dir):
for file_name in files:
if file_name.endswith(".py"):
full_path = "{}{}{}".format(dir_name, os.path.sep, file_name)
yield full_path
for file_path in pyfiles():
print(file_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment