The Ironic Atom

Exciting your orbitals

  • HOME
  • About

Archive for the ‘ Python Tips and Tricks ’ Category

Windowing an iterable with itertools

  • April 24th, 2010
  • Posted in General Programming . Python . Python Tips and Tricks

As any good python developer does, I make heavy use of python’s iterator protocol.  It’s easy, it’s efficient, it’s a good thing.  As you know, an iterator consumes an iterable piece by piece each time “next” is called — which means that the next value cannot be peeked without incrementing the iterator (thus consuming the [ READ MORE ]

The awesomest simple template – part deux

  • September 6th, 2009
  • Posted in Python . Python Tips and Tricks

Ok. So recently I posted some code for a simple templating utility that I wrote. I’ve done some refactoring and have an even cooler version. This version better extends the behavior of string.Template and I’ve found it to be far more intuitive to use.  Without further ado: import string class SimpleTemplate(string.Template): """ [ READ MORE ]

The Simplest Template

  • August 23rd, 2009
  • Posted in Python . Python Tips and Tricks

Ready for the simplest templating utility ever?  I was trying to prepare some JSON data stored in a tree and needed some simple code to generate templated text.  Below is a wrapper for python’s string.Template class: import string class SimpleTemplate(string.Template): """ Takes a string template and a tuple or list of identifier names [ READ MORE ]

Recent Posts

  • Windowing an iterable with itertools
  • merging changes in plone
  • Parsing nginx log files
  • What is programming?
  • The awesomest simple template – part deux

Posts by date

September 2010
M T W T F S S
« Apr    
 12345
6789101112
13141516171819
20212223242526
27282930  

RSS Cooking with Python

  • Dragon Lexical Analyzer (Python)
  • collections.MutableMapping wrapper around _winreg (Python)
  • BI_RLE Decoder (Python)
  • Simple way to execute multiple process in parallel (Python)
  • Script para saber calida del aire Santiago de Chile (Python)
  • A simple function benchmarking module (Python)
  • IP address and CIDR mask conversion to network and broadcast (Python)
  • monty hall problem (Python)
  • Attributes as local variables inside a with clause (Python)
  • sending gmail though python code (Python)

My del.icio.us Links

  • Zope.org - HTTP Caching and Zope
  • Boot Linux from a FireWire device
  • Fedora Nvidia Driver Install Guide
  • RenderingProject/compiz - FedoraProject
  • Configuring an nVidia Card and Kernel Modules — Fedora Unity Project
  • Copyright © 2010 The Ironic Atom
  • Theme designed by mono-lab
  • Powerd by WordPress