PeterGrillot
6/17/2016 - 1:09 PM

Python - Get file names in folder and export a txt

Python - Get file names in folder and export a txt

import os
import glob
files = glob.glob ('*.*')
with open (os.path.realpath('filenames.txt'), 'w') as in_files:
    for eachfile in files: in_files.write(eachfile+'\n')
input('Press ENTER to exit')