Librenix  
(Show all Python articles . . .
)  
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Charming Python: Generator based state machines

Up
vote
Down

This article shows how to use Python's new generators to simplify state machines and simulate coroutines. It also shows additional patterns for the use of generators, in hopes of bringing readers further into the mindset of "resumable functions." If generators are new to you, you should first review the introduction to simple generators. There are a lot of benefits to using simple generators. In addition to offering more natural ways of expressing the flow of a class of problems, generators can dramatically improve many inefficiencies.
 read more | mail this link | score:6825 | -Debinay, July 19, 2002 (Updated: November 16, 2003)
More Programming articles...

Gallery Wrapped Abstract Art

Selected articles

VPS: Xen vs. OpenVZ

Linux vs. Windows: Why Linux will win

Space Tyrant: A threaded game server project in C

Tutorial: Introduction to Linux files

Why software sucks

Why Programmers are not Software Engineers

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin