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

2016-03-07 Thread MRAB
On 2016-03-08 01:37, Jinghui Niu wrote: On Monday, March 7, 2016 at 5:16:44 PM UTC-8, Ben Finney wrote: Jinghui Niu 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 Sublim

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

2016-03-07 Thread Steven D'Aprano
On Tue, 8 Mar 2016 12:04 pm, Jinghui Niu wrote: > May I take this opportunity to ask a bold question for a beginner: 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? Could you > shed some insights? Thanks.

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

2016-03-07 Thread Chris Angelico
On Tue, Mar 8, 2016 at 12:37 PM, Jinghui Niu wrote: > 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,

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

2016-03-07 Thread Ben Finney
Jinghui Niu writes: > 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 n

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

2016-03-07 Thread Jinghui Niu
On Monday, March 7, 2016 at 5:16:44 PM UTC-8, Ben Finney wrote: > Jinghui Niu 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 f

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

2016-03-07 Thread Ben Finney
Jinghui Niu 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 sui

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

2016-03-07 Thread Jinghui Niu
On Monday, March 7, 2016 at 5:00:57 PM UTC-8, Ben Finney wrote: > Jinghui Niu writes: > > > Thank you for your reply. So if for a beginner learner who doesn't > > care so much about Unix-compliant, which one is a better choice for > > learning purpose? > > Learn to care about the difference :-)

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

2016-03-07 Thread Ben Finney
Jinghui Niu writes: > Thank you for your reply. So if for a beginner learner who doesn't > care so much about Unix-compliant, which one is a better choice for > learning purpose? Learn to care about the difference :-) They are both useful and both do different things. -- \ “I must say tha

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

2016-03-07 Thread Jinghui Niu
On Monday, March 7, 2016 at 1:37:45 PM UTC-8, Ben Finney wrote: > Jinghui Niu writes: > > > Hi, I've been studying python 3 modules. I'm a bit confused about the > > possibly overlap between fnmatch() and glob(), they seem to achieve > > the same goals exactly. Why duplicate? > > >From the modul

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

2016-03-07 Thread Ben Finney
Jinghui Niu writes: > Hi, I've been studying python 3 modules. I'm a bit confused about the > possibly overlap between fnmatch() and glob(), they seem to achieve > the same goals exactly. Why duplicate? From the module documentation: Note that unlike fnmatch.fnmatch(), glob treats filenames

fnmatch() vs. glob.glob()

2016-03-07 Thread Jinghui Niu
Hi, I've been studying python 3 modules. I'm a bit confused about the possibly overlap between fnmatch() and glob(), they seem to achieve the same goals exactly. Why duplicate? Or maybe something I've missed? Thank you. -- https://mail.python.org/mailman/listinfo/python-list