Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79214
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-10-16 07:12 -0700 |
| References | <mailman.14888.1413398369.18130.python-list@python.org> <7490ed54-3116-45da-85d1-f9ce4bf29c5e@googlegroups.com> <mailman.14924.1413468316.18130.python-list@python.org> |
| Message-ID | <6bb7675c-e821-4a10-84c2-582197afd237@googlegroups.com> (permalink) |
| Subject | Re: Creating a counter |
| From | Simon Kennedy <sffjunkie@gmail.com> |
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 what you got from calling > os.listdir() in the first place. So I was more inclined to think that > the OP was only trying to count one thing. I read the OP's question as he was looking for the string in the contents of each file in the directory not in the file names themselves but as you say... > In any case, the question turned out to actually be about printing, > not counting.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Creating a counter Shiva <shivaji_tn@yahoo.com> - 2014-10-15 18:39 +0000
Re: Creating a counter Simon Kennedy <sffjunkie@gmail.com> - 2014-10-16 06:44 -0700
Re: Creating a counter Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-16 08:04 -0600
Re: Creating a counter Simon Kennedy <sffjunkie@gmail.com> - 2014-10-16 07:12 -0700
csiph-web