Creating a counter

Terry Reedy tjreedy at udel.edu
Wed Oct 15 15:26:52 EDT 2014


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




More information about the Python-list mailing list