[Tutor] What is missing?
Sun, 03 Feb 2002 23:15:20 -0500
DIR = "D:\\dp_test"
for filename in os.listdir(DIR):
full_path = os.path.join(DIR, filename)
myFile = open(full_path, 'r')
inFile = open('dp_hr.txt', 'w')
count = len(myFile.readlines())
print filename + ",", count
inFile.write(filename + ', ' + string(count))
There are 325 files in the directory. The program works up until the
print statement which displays all the 325 files with the corresponding
lines contained in the respective files. The write statement only writes
the last file and line_numbers for the last file. Should I put it in