Last change
on this file since 6568 was
6568,
checked in by kristy, 16 years ago
|
new scripts that encompass all changes to this date
|
File size:
488 bytes
|
Line | |
---|
1 | """Function to return the length of a file. |
---|
2 | |
---|
3 | Intended to be used for simplfying the creation of boundary_tags in |
---|
4 | run_model.py |
---|
5 | |
---|
6 | Input: filename |
---|
7 | Returns: number of lines in file |
---|
8 | """ |
---|
9 | |
---|
10 | def file_length(in_file): |
---|
11 | '''Function to return the number of lines in a file. |
---|
12 | |
---|
13 | in_file: Path to the file to get number of lines in. |
---|
14 | |
---|
15 | Returns: number of lines in file |
---|
16 | ''' |
---|
17 | |
---|
18 | fid = open(in_file) |
---|
19 | data = fid.readlines() |
---|
20 | fid.close() |
---|
21 | return len(data) |
---|
22 | |
---|
Note: See
TracBrowser
for help on using the repository browser.