Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28646
| References | <feae1d5a-c477-4e21-8136-c14e38672cb9@googlegroups.com> |
|---|---|
| Date | 2012-09-07 07:48 +1000 |
| Subject | Re: Function for examine content of directory |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.333.1346968110.27098.python-list@python.org> (permalink) |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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