Python text file processing

Have done quite a few text file processing job in work, some tips of using python for text processing, 1, file open and close, in most cases, you will need to process all the files inside one folder, or all the files with the same extension inside one folder, to process the files one by one, this can be done by using following example as, src = "D:\\mywork\\" filenamelist=os.listdir(src) for y in xrange(len(filenamelist)): #process your file here.