Created
August 26, 2020 13:12
-
-
Save xiaoxiao921/bd1cc9f8e6b084ee77a213ead92e34c0 to your computer and use it in GitHub Desktop.
Print paths of all files in subdirectories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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