filling a dictionary from a QTableWidget

0

Hello I hope you can help me:

is the example table:

The intention is to get the values of the items and send them using the firebase set function to get something like that inside firebase:

New_Tbale_Firebase

    KLSJDSKJFK2131231 #key aleatoria proporcionada por firebase
        uno:12
        dos:23
        tres:21

    DJASKLD21331231K #key aleatoria proporcionada por firebase
        uno:'None'
        dos:'sdsd'
        tres:'sdsd'

    KSKLWOWKDMKDSDLS #key aleatoria proporcionada por firebase
        uno:'None'
        dos:'second'
        tres:'None'

this is what I have:

        for a in range(self.tabla.rowCount()): #Obtengo la cantidad de items
        for b in range(self.tabla.columnCount()):
            try:

                single_text = self.tabla.item(a,b).text() #defino que quiero obtener el texto de cada item segun vaya cambiando la posison del contador FOR
                if single_text != '':
                    #print(single_text)
                    for a in l:
                        firebase.set({ #si encuentra un valor lo setea a la base de datos
                            a:single_text
                        })

                else:
                        pass
            except:
                print("None")
    
asked by Revsky01 25.07.2018 в 21:25
source

0 answers