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


Groups > comp.lang.python > #28646

Re: Function for examine content of directory

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.022
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'python': 0.09; 'sep': 0.09; 'subject:Function': 0.09; 'type;': 0.09; 'extension': 0.13; 'already,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'module': 0.19; 'sort': 0.21; 'trying': 0.21; 'received:209.85.214.174': 0.21; "haven't": 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; "i'm": 0.29; 'fri,': 0.30; 'function': 0.30; 'etc.)': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'easier': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'containing': 0.61; 'map': 0.61; 'directly.': 0.78; 'subject:content': 0.84; 'examine': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ppg1yoNaCGCRQ66rMgB8uTpxvwo1lAE8EJamPLVsQKU=; b=lmsnCrObD/iiEDJt5KxNV6qXEnS13bZ4bic+V/42KIU+FPSoiHJw454Lx4OUD/Mdc0 EpJht7Ep1U/DnV4Ji6X91hJMMI/uWh36H2Wuj0c5Zv8XIvPUckvUyBVnzP+Zmbva3gBh slrc1fkK0sPyuQ7+VZcmZsvj4Oxe3eEal1yHJ6UYKlFNKpWhQOTA5Evo3KeqbEJT593n YmH3Ha6WiM2ZdXH+MFLznYFmawZ6d9+ovVRyahTJ9vfUs5okVrzgb9IASdQNkHxwzznj sUWeQAnP9Q5F49Tf8qxCDpLN6xggyBEc+ezWThzQqCznXvgprMtlsWwnO3rnGZyDJe32 aCOg==
MIME-Version 1.0
In-Reply-To <feae1d5a-c477-4e21-8136-c14e38672cb9@googlegroups.com>
References <feae1d5a-c477-4e21-8136-c14e38672cb9@googlegroups.com>
Date Fri, 7 Sep 2012 07:48:27 +1000
Subject Re: Function for examine content of directory
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.333.1346968110.27098.python-list@python.org> (permalink)
Lines 8
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1346968110 news.xs4all.nl 6966 [2001:888:2000:d::a6]:60534
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28646

Show key headers only | View raw


On Fri, Sep 7, 2012 at 12:56 AM, Tigerstyle <laddosingh@gmail.com> wrote:
> I'm trying to write a module containing a function to examine the contents of the current working directory and print out a count of how many files have each extension (".txt", ".doc", etc.)

If you haven't already, look into the Python 'dict' type; you may find
it easier to work with for this sort of job. You can map an extension
("txt") to its count (4) directly.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Function for examine content of directory Tigerstyle <laddosingh@gmail.com> - 2012-09-06 07:56 -0700
  Re: Function for examine content of directory Ian Foote <ian@feete.org> - 2012-09-06 16:06 +0100
  Re: Function for examine content of directory MRAB <python@mrabarnett.plus.com> - 2012-09-06 16:20 +0100
    Re: Function for examine content of directory Tigerstyle <laddosingh@gmail.com> - 2012-09-06 13:26 -0700
    Re: Function for examine content of directory Tigerstyle <laddosingh@gmail.com> - 2012-09-06 13:26 -0700
  Re: Function for examine content of directory Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-06 17:26 -0400
  Re: Function for examine content of directory Chris Angelico <rosuav@gmail.com> - 2012-09-07 07:48 +1000
  Re: Function for examine content of directory Tigerstyle <laddosingh@gmail.com> - 2012-09-07 07:23 -0700
  Re: Function for examine content of directory Tigerstyle <laddosingh@gmail.com> - 2012-09-07 07:28 -0700
    Re: Function for examine content of directory Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-07 15:21 -0400

csiph-web