BRIAN ERICK MUNIVE PEREZ BRIAN ERICK MUNIVE PEREZ - 1 month ago 18
Python Question

Set all the values from a Forloop

I need to set all the values into a textctrl but it just set the las value

lstA = list(CONTENIDO)
for RT in lstA:
print RT
self.loggerb.SetValue(RT)

Answer

perhaps you want

self.loggerb.SetValue(", ".join(CONTENIDO))

or

self.loggerb.SetValue("\n".join(CONTENIDO))

or maybe you want something like

for RT in CONTENIDO:
    print RT
    self.loggerb.SetValue(RT)
    self.logggerb.Update() # force gui update
    wx.Sleep(1) # wait a second before going to next value   
Comments