Answers for "access all files in folder python"

2

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
0

Get all file in folder Python

path = "C:code"

import glob

txtfiles = []
for file in glob.glob(path + "\*.m4a"):
    txtfiles.append(file)

for item in txtfiles:
    print(item)
Posted by: Guest on November-12-2021

Code answers related to "access all files in folder python"

Python Answers by Framework

Browse Popular Code Answers by Language