Ich habe ein recht banales Problem und komme schlichtweg nicht auf die Lösung, vllt kann mir ja jemand fix nen Denkanstoß geben.
Folgendes Geschehen:
Ich habe mit pyqt eine GUI gebastelt und in der gui sind 25 kleine vierecke als label-bilder (Das Spielboard von satoshimines)
Während der Bot läuft verändert sich das Bild der 25 Teile konstant.
Dies musste ich allerdings bei jedem Bild etwas peinlich umsetzen, folgender code:
Code: Alles auswählen
#Reset GUITiles
self.tile1.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile2.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile3.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile4.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile5.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile6.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile7.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile8.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile9.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile10.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile11.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile12.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile13.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile14.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile15.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile16.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile17.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile18.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile19.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile20.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile21.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile22.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile23.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile24.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
self.tile25.setPixmap(QtGui.QPixmap(_fromUtf8("tileNew.png")))
Ich denke man sollte doch recht simpel per Schleife darüber iterieren können, allerdings funktionieren Versuche wie etwa den Label namen durch eine Variable + i zu ersetzen nicht.
Was habe ich für Möglichkeiten?
Danke für eure Hilfe!