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


Groups > comp.lang.python > #79214

Re: Creating a counter

X-Received by 10.236.26.200 with SMTP id c48mr1031604yha.46.1413468728602; Thu, 16 Oct 2014 07:12:08 -0700 (PDT)
X-Received by 10.50.23.46 with SMTP id j14mr315123igf.17.1413468728496; Thu, 16 Oct 2014 07:12:08 -0700 (PDT)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!dc16no3274291qab.1!news-out.google.com!rp1ni31966igb.0!nntp.google.com!uq10no11852162igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Thu, 16 Oct 2014 07:12:07 -0700 (PDT)
In-Reply-To <mailman.14924.1413468316.18130.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=217.46.241.89; posting-account=qpDnJAoAAAAffpfhI2O4BXh9evsC4TaC
NNTP-Posting-Host 217.46.241.89
References <mailman.14888.1413398369.18130.python-list@python.org> <7490ed54-3116-45da-85d1-f9ce4bf29c5e@googlegroups.com> <mailman.14924.1413468316.18130.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <6bb7675c-e821-4a10-84c2-582197afd237@googlegroups.com> (permalink)
Subject Re: Creating a counter
From Simon Kennedy <sffjunkie@gmail.com>
Injection-Date Thu, 16 Oct 2014 14:12:08 +0000
Content-Type text/plain; charset=ISO-8859-1
Lines 11
Xref csiph.com comp.lang.python:79214

Show key headers only | View raw


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


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