i Don't get why it makes trouble

azrael jura.grozni at gmail.com
Thu Aug 13 20:56:49 CEST 2009


>>> j
[u'Tata', u'Oriovac', u'PrimorskoGoranska', u'hrvatska', u'Kuna']
>>> len(j)
5
>>> h = """SELECT distinct u.id_ulica, o.id_opcina, z.id_zupanija, d.id_drzava, v.id_valuta FROM   ulica as u, opcina as o, zupanija as z, drzava as d, valuta as v  WHERE  u.naziv = '%s' AND o.naziv = '%s' AND z.naziv = '%s' AND d.naziv = '%s' AND v.naziv = '%s'""" % (j)
Traceback (most recent call last):
  File "<string>", line 1, in <string>
TypeError: not enough arguments for format string


I want to format the string. the list has five elements and the string
has five placeholder but it wont format the string



More information about the Python-list mailing list