source: anuga_work/production/australia_ph2/sydney/file_length.py @ 6529

Last change on this file since 6529 was 6297, checked in by jgriffin, 15 years ago

function to return the length of a file. Used in run_model.py to return the number of points in the landward_boundary polygon.

File size: 309 bytes
Line 
1"""Function to return the length of a file.
2
3Intended to be used for simplfying the creation of boundary_tags in
4run_model.py
5
6Input: filename
7Returns: number of lines in file
8"""
9def file_length(in_file):
10    fid = open(in_file)
11    data = fid.readlines()
12    fid.close()
13    return len(data)
14
Note: See TracBrowser for help on using the repository browser.