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-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 found.

Re: Creating a counter

2014-10-16 Thread Ian Kelly
On Thu, Oct 16, 2014 at 7:44 AM, Simon Kennedy sffjun...@gmail.com 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

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 is

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

Re: Creating a counter

2014-10-15 Thread Ian Kelly
On Wed, Oct 15, 2014 at 12:39 PM, Shiva shivaji...@yahoo.com.dmarc.invalid 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

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

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

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

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