作者jlovet (打不赢怪兵器不好)
看板Python
标题Re: [闲聊] pydoc glob 有几个字看不懂
时间Tue Sep 8 16:14:40 2009
※ 引述《jlovet (打不赢怪兵器不好)》之铭言:
: $pydoc glob
: FUNCTIONS
: glob(pathname)
: Return a list of paths matching a pathname pattern.
: The pattern may contain simple shell-style wildcards a la fnmatch.
: iglob(pathname)
: Return a list of paths matching a pathname pattern.
: The pattern may contain simple shell-style wildcards a la fnmatch.
: 问题
: glob跟iglob有差吗?
: a la fnmatch 是什麽意思?
不是 case insensitive喔...
iglob会回传一个iterator
In [4]: a=iglob("*.h")
In [5]: print a
<generator object at 0x960644c>
In [6]: print a.next()
1.h
In [8]: print a
<generator object at 0x9eb44ac>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.123.102.254
1F:推 linmic:win32 insensitive, linux sensitive, and iterator return 09/08 16:15
2F:→ linmic:我楼上那篇有贴... 09/08 16:16
3F:推 aquarianboy:喔!! 原来是这样,果然手册要读 :) 09/08 17:22