Skip to main content

Learn about > python iterator example

Search results

1-15 of 850 resultsView all results

Search result title:

Charming Python: Iterators and simple generators - IBM

Search result description:Sep 1, 2001 ... Python 2.2 introduces a new construct accompanied by a new keyword. ... To
close, let me present one more generator example that comes ...

Search result title:

Discover Python, Part 7: Explore the Python type hierarchy - IBM

Search result description:Dec 6, 2005 ... This example demonstrates three means for iterating through a dictionary: by
using the Python iterator returned from the iterkeys() , itervalues() ...

Search result title:

Charming Python: Generator-based state machines - IBM

Search result description:Jul 1, 2002 ... In this installment of Charming Python, David Mertz explains all the relevant ...
But a more sophisticated generator example is likely to deal with ...

Search result title:

High-performance XML parsing in Python with lxml - IBM

Search result description:Mar 24, 2011 ... lxml is a fast yet flexible library for XML processing in Python. ... Software
versions and sample data used in this article .... extension of the ElementTree API
. iterparse returns a Python iterator for the selected element context.

Search result title:

Charming Python: Decorators make magic easy - IBM

Search result description:Dec 29, 2006 ... With version 2.2, Python grew a custom metaclass mechanism that went a ... In
the older style, you would use a classmethod() call, for example, as follows: .... it
is less straightforward to do lazily if and only if an iterator object is ...

Search result title:

Discover Python, Part 8: Reading and writing data using Python's - IBM

Search result description:Jan 3, 2006 ... First, we review a simple way to output data in Python, using the print ... As this
example shows, writing data is easy with the print statement. .... You can then
split the string and iterate over the lines in the file within a for loop.

Search result title:

Charming Python: Python elegance and warts, Part 1 - IBM

Search result description:Mar 28, 2007 ... Moreover, more and more Python objects have become iterators or iterator-like;
for example, what used to require the .xreadlines() method or ...

Search result title:

Discover Python, Part 6: Programming in Python - IBM

Search result description:Oct 25, 2005 ... This example provides three different for loops that all iterate over the same string
. The first for loop iterates over the string "Python Is A Great ...

Search result title:

Charming Python: Using combinatorial functions in the itertools - IBM

Search result description:Jun 12, 2003 ... Python 2.2 introduced simple generators to the Python language and ... But even
the simple example above shows the FP flavor of iterator ...

Search result title:

Building and filling out templates with Python and Cheetah - IBM

Search result description:Aug 9, 2005 ... Leonard Richardson is the author of many Python applications and .... The
previous examples stop right before they have to iterate over the ...

Search result title:

Comments on UIMA's Python support - IBM

Search result description:Jul 30, 2006 ... UIMA's Python support really needs to take advantage of Python's iterator support
. The following code from the sample:: iterator = tcas.

Search result title:

Tip: Using generators - IBM

Search result description:Oct 1, 2002 ... Generators are a very powerful new language feature of Python 2.2. In this ... A
node iterator visits every node in an XML document in turn, following the ... is the
main example in the official specification for Python generators).

Search result title:

Python 3 primer, Part 1: What's new - IBM

Search result description:Dec 19, 2008 ... Python 3 is the latest version of Guido van Rossum's powerful ... The following
example opens the file log.txt for appending and assigns the ...

Search result title:

Charming Python: Text processing in Python - IBM

Search result description:This article summarizes Python's text processing facilities for the programmer
new ... triple-quoting is an easy way to define a string, as in the following example
: ...

Search result title:

XML Matters: Process XML in Python with ElementTree - IBM

Search result description:Jun 24, 2003 ... Of course, Python already has several XML API's included in its standard .... But
in the ElementTree example, you do not really need to find all the .... XML trees
generically, generateDS is code generator for Python modules to ...


1-15 of 850 resultsView all results