Answers for "for all files in directory python"

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
0

python dir all files

import os

for root, dirs, files in os.walk("."):
    for filename in files:
        print(filename)
Posted by: Guest on February-12-2021

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

Python Answers by Framework

Browse Popular Code Answers by Language