Is there a defacto template application for Python?
I am trying to auto generate C code for use in unit tests from python
My original approach using print statements is very clunky and error prone
It struck me that a template application such as those used in web app development might be a more elegant solution
My initial research seems to suggest Cheetah is a good option, however there seem to be many potential options
My requirements would be that it is reliable and simple – would Cheetah represent ‘best practice’ for this sort of application?
While there are many standalone and powerful template engines in Python there is one in Python standard library.
There is Template class in string module that implements PEP 292 “Simpler String Substitutions” that is very easy to learn and use. Personally I prefer to use this in my unit tests.