Dos consultas sobre MySQL

Mikel Larreategi mlarreategi en codesyntax.com
Lun Abr 23 17:01:17 CEST 2007


Javier Castrillo(e)k dio:
> On 23/04/07, Gerardo Juarez <gerardo en computo-industrial.com.mx> wrote:
>>
>> Hola,
>>
>> Necesitas quitar el espacio entre '%' y la 's':
>>
>>   LblQNMA = wx.StaticText(panelMA, -1, "Nombre: %s" % (q[0]), (50, 80))
>>   LblQDMA = wx.StaticText(panelMA, -1, "DNI: %s" % (q[1]), (50, 80))
>>   self.MA.Show(True)
>>
> 
> saqué el espacio y me da el mismo error.  :-(
> 
> /usr/bin/python -u
> "/home/javier/python/wxpython/proyecto_sancabase/sancabase.py"
> Traceback (most recent call last):
>  File "/home/javier/python/wxpython/proyecto_sancabase/sancabase.py",
> line 447, in OnModAlumnos
>    LblQNMA = wx.StaticText(panelMA, -1, "Nombre: %s" % (q[0]), (50, 80))
> TypeError: not all arguments converted during string formatting
> 
> 

Prueba pasando una tupla real, o si no elimina los paréntesis, es decir:

LblQNMA = wx.StaticText(panelMA, -1, "Nombre: %s" % (q[0],), (50, 80))

ó

LblQNMA = wx.StaticText(panelMA, -1, "Nombre: %s" % q[0], (50, 80))


Saludos,

Mikel


-- 
Mikel Larreategi
mlarreategi en codesyntax.com

CodeSyntax
Azitaingo Industrialdea 3 K
E-20600 Eibar
Tel: (+34) 943 82 17 80




Más información sobre la lista de distribución Python-es