a guest Jun 7th, 2017 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Code to be executed:
- import csv
- import os
- directory = '/home/misterwhite/Documents/pagecounts/'
- delim = ' '
- for file in os.listdir(directory):
- with open(directory+file, 'r') as f:
- reader = csv.reader(f, delimiter = delim)
- start = reader.__next__()
- max_length = [len(i) for i in start]
- for row in reader:
- for i in range(len(row)):
- max_length[i] = max(len(row[i]),max_length[i])
RAW Paste Data