Created
January 2, 2018 10:26
-
-
Save Kyu/682ea72c22c8636e7bd92fe0afae9a39 to your computer and use it in GitHub Desktop.
Outputs all file names in dir to file
This file contains hidden or 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 os | |
path = os.getcwd() | |
for root, dirs, files in os.walk(path): | |
with open('names.txt', 'w') as f: | |
f.writelines([i +'\n' for i in files]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment