Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Thursday, 16 October 2014 15:05:47 UTC+1, Ian wrote: > I would have suggested a Counter if I thought it fit the OP's use > case. If you're listing directory contents, you're not going to have > any repeated strings, so all the counts will be 1, and your Counter > might as well be a list, which

Re: Creating a counter

2014-10-16 Thread Ian Kelly
On Thu, Oct 16, 2014 at 7:44 AM, Simon Kennedy wrote: > When you looked through the other answers and found a solution you're happy > with that does not use the standard library you can look through the > documentation and find a stdlib > (https://docs.python.org/2.7/library/index.html) provide

Re: Creating a counter

2014-10-16 Thread Simon Kennedy
On Wednesday, 15 October 2014 19:39:43 UTC+1, Shiva wrote: > 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 > foun

Re: Creating a counter

2014-10-16 Thread Shiva
> > Python3: >print(counter, end='\r') > > Gary Herron > > Thanks, that is what I was looking up - \r carriage return without linefeed. Thanks again! Shiva -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a counter

2014-10-15 Thread Gary Herron
On 10/15/2014 11:39 AM, 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

Re: Creating a counter

2014-10-15 Thread MRAB
On 2014-10-15 20:24, Vincent Vande Vyvre wrote: Le 15/10/2014 20:39, Shiva a écrit : 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 increm

Re: Creating a counter

2014-10-15 Thread Vincent Vande Vyvre
Le 15/10/2014 20:39, Shiva a écrit : 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

Re: Creating a counter

2014-10-15 Thread Terry Reedy
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?

Re: Creating a counter

2014-10-15 Thread Ian Kelly
On Wed, Oct 15, 2014 at 12: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. >

Creating a counter

2014-10-15 Thread Shiva
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? If I use a print() within a if condi