New to Python.
droog at orange.gov
Thu Mar 18 04:07:05 CET 2004
I was looking for the simpliest way of doing it. This is what I tried
f = open('C:\Python23\Samples\Bob.txt', 'r')
counter = 0
line = f.readline()
if len(line) == 0:
counter = counter + 1
print 'Found it ' + str(counter)
On Thu, 18 Mar 2004 02:53:48 GMT, droog <droog at orange.gov> wrote:
>I have just started learning python and encountered a problem.
>All I wanted to do, was to open a text file search and count the
>number of occurances of a single word and print that count.
>Thanks for help.
More information about the Python-list