什么是python生成器? [英] What are python generators?
本文介绍了什么是python生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
您可以使用Python生成器函数做什么?
Possible Duplicate:
What can you use Python generator functions for?
我尝试阅读有关python生成器的信息,但对有关可以使用生成器的概念的了解不多,我是python的新手
I tried to read about python generators but did not understand much about the concept as to what we can do with generators, I am new to python
请让我知道 谢谢
推荐答案
此处的演示很好地解释了生成器:
The presentation here explains generators very well:
http://www.dabeaz.com/generators/index.html
我还没有找到更高级的流水线方法的用途,但是我一直使用通用技术来解析日志文件.
I have yet to find a use for the more advanced pipelining stuff, but I use the general technique all the time to parse logfiles.
这篇关于什么是python生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文