Skip to content

Instantly share code, notes, and snippets.

@xiaoxiao921
Created August 26, 2020 13:12
Show Gist options
  • Save xiaoxiao921/bd1cc9f8e6b084ee77a213ead92e34c0 to your computer and use it in GitHub Desktop.
Save xiaoxiao921/bd1cc9f8e6b084ee77a213ead92e34c0 to your computer and use it in GitHub Desktop.
Print paths of all files in subdirectories
import pathlib
import os
import sys
with open('paths.txt', 'w') as f:
sys.stdout = f
directory = os.path.dirname(os.path.realpath(__file__))
for filepath in pathlib.Path(directory).glob('**/*'):
path = filepath.absolute().as_posix()[89:]
if not path.endswith("meta"):
print(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment