Tuesday, 1 October 2013

Reading all files from a directory

Reading all files from a directory

Following code is to read all files in download directory,but when i
execute this code it won't print(display), what is wrong with this code..?
import glob
path = '/home/kumarswamys/Adobe/download/*.html'
files=glob.glob(path)
for file in files:
f=open(file, 'r')
f.readlines()
f.close()

No comments:

Post a Comment