[Tutor] Reading and Writing
Erik Price
erikprice@mac.com
Thu, 29 Aug 2002 14:53:26 -0400
On Thursday, August 29, 2002, at 11:48 AM, Ibraheem Umaru-Mohammed
wrote:
> Iti also probably neater to use the glob module, as glob returns full
> pathnames, whereas with the os.listdir function, we find ourselves
> constructing the path.
Why does os.path.splitext() and fnmatch.fnmatch() use the Unix-style
shell globbing syntax for pattern-matching? I find "glob"-style
pattern-matching to be somewhat weak after having used regular
expressions (especially PCREs). There must be some way to use (or some
module that uses) regexes instead.
Is that for easiness for newbies or to appease sysadmins used to bash?
(I like bash too but Python seems like it should be more powerful than
just globbing.)
Either way, it's no match for regular expressions.
(Hah! I kill me! ;)
Erik
--
Erik Price
email: erikprice@mac.com
jabber: erikprice@jabber.org