Re: [閒聊] pydoc glob 有幾個字看不懂

看板Python作者 (打不贏怪兵器不好)時間16年前 (2009/09/08 16:14), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串3/3 (看更多)
※ 引述《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

09/08 16:15, , 1F
win32 insensitive, linux sensitive, and iterator return
09/08 16:15, 1F

09/08 16:16, , 2F
我樓上那篇有貼...
09/08 16:16, 2F

09/08 17:22, , 3F
喔!! 原來是這樣,果然手冊要讀 :)
09/08 17:22, 3F
文章代碼(AID): #1AfX9oOa (Python)
文章代碼(AID): #1AfX9oOa (Python)