To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / python-intro.py @ 2:c6c0578924fa

History | View | Annotate | Download (220 Bytes)

1
source = open('data.txt', 'r')
2

    
3
# reads header line
4
source.readline()
5

    
6
number = 0
7

    
8
# count number of data records
9
for line in source:
10
    number = number + 1
11
source.close()
12

    
13
print "Total number of data records:", number