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:6848 | -Debinay, July 19, 2002 (Updated: November 16, 2003)
More Programming articles...

Buy Digital Art on Acrylic

coding headlines

OpenShift Online: a non-developer guide

Detailed Error Handling In Bash

Tutorial: Create an NFS-like Storage Server with GlusterFS on Ubuntu 12.10

Unix: Shell Script Wrapper Examples

Introduction to Perl one-liners

Tutorial: Install SVN, Configure multi-protocol access (Ubuntu 11.10)

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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