SoFunction
Updated on 2024-11-13

Python implementation of filtering out files of specified file types from a directory


#!/usr/bin/env python

import glob
import os
(“./”)
for file in (“*.py”):
print file

print “#######Another One##########”

for file in (“./”):
if (“.py”):
print file

print “#######Another Two##########”
for root, dirs, files in (“./”):
for file in files:
if (“.py”):
print (root, file)

print “#######Another Three##########”

(“./”)
filename_arr={}
i=0
for files in (“*.py”):
filename_arr[i] = files
i += 1

for key, value in filename_arr.items():
print key, value