Using Python String Formatting with Lists

You should take a look to the format method of python. You could then define your formatting string like this :

>>> s="{0} BLAH BLAH {1} BLAH {2} BLAH BLIH BLEH"
>>> x = ['1', '2', '3']
>>> print s.format(*x)
'1 BLAH BLAH 2 BLAH 3 BLAH BLIH BLEH'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)