String.Template Source ...

Peter Otten __peter__ at web.de
Fri May 8 14:23:53 CEST 2009


Mic Pringle wrote:

> I'd like to have a 'dig around' in the source for String.Template, but
> can't seem to find where it lives.

I assume that you mean string.Template.

> Could someone please let me know where about's in the source (perhaps
> a path?) the template functions live ?
> 
> I'm working on a Mac, using Leopard and the bundled version of Python.

Import the module and inspect its __file__ attribute:

>>> import string
>>> string.__file__
'/usr/lib/python2.6/string.pyc'

This means that the string module's path is /usr/lib/python2.6/string.py 
over here.




More information about the Python-list mailing list