2006年04月09日 星期日 09:58
谢谢 -- ------------------------------------------------------------------- python-chinese list Python中文技术讨论邮件列表 发言: 发邮件到 python-chinese at lists.python.cn 订阅: 发送 subscribe 到 python-chinese-request at lists.python.cn 退订: 发送 unsubscribe 到 python-chinese-request at lists.python.cn 详细说明: http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060409/60c0dab7/attachment.htm
2006年04月09日 星期日 13:50
在06-4-9,Geoffery>>>嘎瑞>>>XuLi <geofferyli at gmail.com> 写道: import os os.listdir('路径名') _______________________________________________ > 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060409/4b0cd386/attachment.html
2006年04月09日 星期日 16:34
谢谢 On 4/9/06, Lee DYER <lee.dyer at gmail.com> wrote: > > > > 在06-4-9,Geoffery>>>嘎瑞>>>XuLi <geofferyli at gmail.com> 写道: > import os > os.listdir('路径名') > > > _______________________________________________ > > 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 > > > > > > _______________________________________________ > 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 > > -- ------------------------------------------------------------------- python-chinese list Python中文技术讨论邮件列表 发言: 发邮件到 python-chinese at lists.python.cn 订阅: 发送 subscribe 到 python-chinese-request at lists.python.cn 退订: 发送 unsubscribe 到 python-chinese-request at lists.python.cn 详细说明: http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060409/c8c2857b/attachment.htm
2006年04月09日 星期日 16:59
可以参考glob模块和os模块里的walk及listdir函数 -- Best Regards, Leo Jay
2006年04月09日 星期日 17:18
def all_files(pattern, search_path, pathsep=os.pathsep): """ Given a search path, yield all files matching the pattern. """ for path in search_path.split(pathsep): for match in glob.glob(os.path.join(path, pattern)): yield match.replace('\','/') if __name__=='__main__': print list(all_files('*.swf', 'images/swf'))[::-1]
Zeuux © 2025
京ICP备05028076号