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


Groups > comp.lang.python > #104300

Re: fnmatch() vs. glob.glob()

X-Received by 10.182.24.41 with SMTP id r9mr18954229obf.25.1457401033333; Mon, 07 Mar 2016 17:37:13 -0800 (PST)
X-Received by 10.50.66.236 with SMTP id i12mr271603igt.7.1457401033283; Mon, 07 Mar 2016 17:37:13 -0800 (PST)
Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!hb3no12385002igb.0!news-out.google.com!k1ni12037igd.0!nntp.google.com!hb3no12384998igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Mon, 7 Mar 2016 17:37:12 -0800 (PST)
In-Reply-To <mailman.17.1457399791.15725.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=207.35.73.115; posting-account=hz_sFAoAAADqJ2KK-KBZNgJPdVJ0tza2
NNTP-Posting-Host 207.35.73.115
References <d8ec5d47-3393-41c3-a06c-0ec058763570@googlegroups.com> <mailman.50.1457386649.10335.python-list@python.org> <14061576-1c44-49bb-a27b-279e43258f06@googlegroups.com> <mailman.15.1457398847.15725.python-list@python.org> <7475bb64-b2e7-45ff-a94e-dbc62f658fab@googlegroups.com> <mailman.17.1457399791.15725.python-list@python.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <a0d8dba4-834b-4e28-95a6-43f8667fe2ce@googlegroups.com> (permalink)
Subject Re: fnmatch() vs. glob.glob()
From Jinghui Niu <niujinghui@gmail.com>
Injection-Date Tue, 08 Mar 2016 01:37:13 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Lines 27
Xref csiph.com comp.lang.python:104300

Show key headers only | View raw


On Monday, March 7, 2016 at 5:16:44 PM UTC-8, Ben Finney wrote:
> Jinghui Niu <niujinghui@gmail.com> writes:
> 
> > May I take this opportunity to ask a bold question for a beginner
> 
> No problem, your questions are on topic here. Thank you for being civil.
> 
> > if I want to mimic Sublime Text's fuzzy search for a file search in
> > given directories, which module of these two would be more suitable?
> 
> You'll need to describe the requirements, I don't know exactly what that
> behaviour is.
> 
> -- 
>  \      "He that loveth father or mother more than me is not worthy of |
>   `\        me: and he that loveth son or daughter more than me is not |
> _o__)                worthy of me." --Jesus, as quoted in Matthew 10:37 |
> Ben Finney

Let me try to describe the behaviours as much as I can here: It is a real-time search, updating the search result as you type; It is very smart, not limiting itself into the verbatim words, but extracting feature strings automatically, e.g., typing "fontz" will match not just "*fontz*", but also "font-size", "fontzipper", etc; It can be switched for certain type of files according specific rules, such as not including ".pyc" files.

My gut feeling is that it is using Regex, but just wonder how I can fit Regex into either fnmatch() or glob() module.

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


Thread

fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 12:17 -0800
  Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 08:37 +1100
    Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 16:53 -0800
      Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:00 +1100
        Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 17:04 -0800
          Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:16 +1100
            Re: fnmatch() vs. glob.glob() Jinghui Niu <niujinghui@gmail.com> - 2016-03-07 17:37 -0800
              Re: fnmatch() vs. glob.glob() Ben Finney <ben+python@benfinney.id.au> - 2016-03-08 12:49 +1100
              Re: fnmatch() vs. glob.glob() Chris Angelico <rosuav@gmail.com> - 2016-03-08 12:56 +1100
              Re: fnmatch() vs. glob.glob() MRAB <python@mrabarnett.plus.com> - 2016-03-08 02:35 +0000
          Re: fnmatch() vs. glob.glob() Steven D'Aprano <steve@pearwood.info> - 2016-03-08 13:19 +1100

csiph-web