''' This code use for get all files of desired type from a directory ''' import os directory="C:/inputFolder/" fileType=".doc" files=[] files=os.listdir(directory) fileCounter=0 for fileName in files: if fileName.endswith(fileType): fileCounter=fileCounter+1 print fileName if fileCounter==0: print "No doc file found at ",directory
Friday, August 20, 2010
python get all files of desired type from a directory
Posted by
Abu Zahed Jony
at
12:32 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
File
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment