Answers for "python for all files in directory"

3

for every file in the folder do python

for file in os.listdir(inputdir):
Posted by: Guest on April-20-2021
5

how to search for a specific file extension with python

import glob, os
os.chdir("/mydir")
for file in glob.glob("*.txt"):
    print(file)
Posted by: Guest on March-06-2020
1

python list all files in directory

import os
 arr = os.listdir()
 print(arr)
 
 >>> ['$RECYCLE.BIN', 'work.txt', '3ebooks.txt', 'documents']
Posted by: Guest on April-15-2021

Code answers related to "python for all files in directory"

Python Answers by Framework

Browse Popular Code Answers by Language