2006年11月02日 星期四 16:54
import os.path
def walk_visit(arg, dirname, filenames):
    if dirname == arg:
        print dirname
def finddir(path, dirname):
    os.path.walk(path, walk_visit, dirname)
if __name__ == "__main__":
    # search the directory named "svn" from current directory
    finddir(".", "svn")
-- 
GoogleTalk: qcxhome at gmail.com
MSN: qcxhome at hotmail.com
My Space: tkdchen.spaces.live.com
BOINC: boinc.berkeley.edu
中国分布式计算总站: www.equn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20061102/8fd383d9/attachment.html 
2006年11月03日 星期五 03:42
按f3也搜索 在 06-11-2,麦田守望者<qcxhome at gmail.com> 写道: > > > import os.path > > def walk_visit(arg, dirname, filenames): > if dirname == arg: > print dirname > > def finddir(path, dirname): > os.path.walk(path, walk_visit, dirname) > > if __name__ == "__main__": > # search the directory named "svn" from current directory > finddir(".", "svn") > > -- > GoogleTalk: qcxhome at gmail.com > MSN: qcxhome at hotmail.com > My Space: tkdchen.spaces.live.com > BOINC: boinc.berkeley.edu > 中国分布式计算总站: www.equn.com > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese >
Zeuux © 2025
京ICP备05028076号