Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83116
| Date | 2015-01-02 14:51 +0100 |
|---|---|
| From | Ervin Hegedüs <airween@gmail.com> |
| Subject | Re: How do I remove/unlink wildcarded files |
| References | <20150102090051.GC22372@arxnet.hu> <20150102102153.GA89926@cskk.homeip.net> <20150102053552.6ed449b8@bigbox.christie.dr> <20150102123604.GB24295@arxnet.hu> <CAPTjJmoHV5OxZYfnDaYjrq-SBDdkWPf1uAhtgd47aioK0FoWFQ@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17323.1420206697.18130.python-list@python.org> (permalink) |
Hi, On Fri, Jan 02, 2015 at 11:59:17PM +1100, Chris Angelico wrote: > On Fri, Jan 2, 2015 at 11:36 PM, Ervin Hegedüs <airween@gmail.com> wrote: > >> And worse, the given re would delete a file named "uni" which doesn't > >> sound ANYTHING like what the OP wanted :-) > > > > yes, you're right - I've missed out a "." before the "*". :) > > Another reason to avoid regexps when you don't actually need them. > Globs are simpler, and have fewer obscure failure modes. it may be at the concrete example in OP is better the glob - but I think in most cases the re modul gives more flexibility, I mean the glob modul can handle the upper/lower chars? (Anyway, now I checked the fnmatch module, which uses re module :)) Cheers: a. -- I � UTF-8
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: How do I remove/unlink wildcarded files Ervin Hegedüs <airween@gmail.com> - 2015-01-02 14:51 +0100
csiph-web