On Tue, 20 Jul 2010 09:53:25 am Steven D'Aprano wrote:

> This is how you would do it with the asterisk: you need a
> meta-template to make a template.

Doh! I meant *without* the asterisk.

> >>> meta = "(a) %%05d | (b) %%0%dd"
> >>> template = meta % 5
> >>> template % (42, 42)
>
> '(a) 00042 | (b) 00042'



-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to