作者linmic ()
看板Python
标题Re: [闲聊] pydoc glob 有几个字看不懂
时间Tue Sep 8 15:24:34 2009
他其实文件有写差异耶,但没提到 case-[in]sensitive 就是了。
The glob module finds all the pathnames matching a specified pattern
according to the rules used by the Unix shell. No tilde expansion is done,
but *, ?, and character ranges expressed with [] will be correctly matched.
This is done by using the os.listdir() and fnmatch.fnmatch() functions in
concert, and not by actually invoking a subshell. (For tilde and shell
variable expansion, use os.path.expanduser() and os.path.expandvars().)
glob.glob(pathname)
"Return a possibly-empty list of path names that match pathname", ... blah
glob.iglob(pathname)
"Return an >>iterator which yields the same values as glob() without actually
storing them all simultaneously."
※ 引述《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 是什麽意思?
--
LinmiC SouL -
http://linmic.cooplex.tw/blog
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.62.77.66
1F:推 jlovet:请问一下你这文件怎麽叫出来的阿 09/08 23:47
2F:→ linmic:官方文件阿...man/--help 只是概略性的功能叙述,要看官方 09/11 08:17