Re: Looking for very light weight template library (not framework)

2008-03-07 Thread Roman Bertle
* Malcolm Greene <[EMAIL PROTECTED]>: > New to Python and looking for a template library that allows Python > expressions embedded in strings to be evaluated in place. In other words > something more powerful than the basic "%(variable)s" or "$variable" > (Template) capabilities. [...] > > Us

grouping in module 'locale'

2008-01-25 Thread Roman Bertle
Hello, I try to format monetary values using the locale module, python2.5: Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56) [GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale

groupby and itemgetter

2006-10-06 Thread Roman Bertle
Hello, there is an example how to use groupby in the itertools documentation (http://docs.python.org/lib/itertools-example.html): # Show a dictionary sorted and grouped by value >>> from operator import itemgetter >>> d = dict(a=1, b=2, c=1, d=2, e=1, f=2, g=3) >>> di = sorted(d.iteritems(), key=

Re: Numeric array in unittest problem

2005-11-21 Thread Roman Bertle
* Alex Martelli <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Sorry Peter, > > > > Try this > > > > import unittest > > import Numeric > > > > class myTest(unittest.TestCase): > > def runTest(self): > > var1 = Numeric.array([1,22]) > > var2 =