Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79175

Re: Creating a counter

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Creating a counter
Date 2014-10-15 15:26 -0400
References <loom.20141015T203348-999@post.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.14894.1413401709.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 10/15/2014 2:39 PM, Shiva wrote:
> Hi,
>
> I am trying to search a string through files in a directory - however while
> Python script works on it and writes a log - I want to present the user with
> count of number of strings found. So it should increment for each string found.
>
> How do I implement it?

n=0 before the look and
n += 1 withing the loop

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Creating a counter Terry Reedy <tjreedy@udel.edu> - 2014-10-15 15:26 -0400

csiph-web