Q:

The result of json.loads(string) is still a string

I'm currently trying to build a database using Python 3.6 (under Spyder) and more precisely sqlite3 (3.14.2).  Since this last module wasn't designed to enable list insertion in the database, i'm using the json (2.0.9) module to transform my lists into strings.  The following function, used to transfer data from a database to another, and where I create and insert list for the first time, returns me weird results :
def database_concatenation():
    global log,name2,name3,timefin,path
    conn = sqlite3.connect(path+name2)
    cursor = conn.cursor()
    conn2 = sqlite3.connect(path+name3)
    cursor2 = conn2.cursor()
    cursor.execute("""select sqlite_version()""")
    print(cursor.fetchall())
    cursor.execute("""SELECT * FROM {}""".format(name2))
    for dataline in cursor.fetchall():
        cursor2.execute("""
                       SELECT * FROM {} 
                   WHERE (
                   timestp = ? 
                   AND idq = ? 
                   AND idz = ? 
                   AND portq = ? 
                   AND portz = ? 
                   AND prot = ?); 
                   """.format(name3) , (dataline[0],dataline[1],dataline[2],dataline[3],dataline[4],dataline[5]))
        result = cursor2.fetchone()

        if result == None:
            with open(path+log,"a") as login:

                login.write(timefin + " Warning !  Unusual connection :" + str(dataline)+ '\n')

            cursor2.execute("""
                       INSERT INTO {}(timestp,
                       idq,
                       idz,
                       portq,
                       portz,
                       prot,
                       Leftmean,
                       Leftstdev,
                       Leftmean10,
                       Leftstdev10,
                       Rightmean,
                       Rightstdev,
                       Rightmean10,
                       Rightstdev10,
                       nbdays) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);""".format(name3), (dataline[0],dataline[1],dataline[2],dataline[3],dataline[4],dataline[5],dataline[6],0,json.dumps([dataline[6]]),0,dataline[7],0,json.dumps([dataline[7]]),0,1))

        else:
            print(result[8])
            Leftmean10 = json.loads(result[8])
            print(Leftmean10)
            Rightmean10 = json.loads(result[12])
            print(type(Leftmean10))

            nbdays = result[14]
            aL,bL = intervalle_confiance(result[6],result[7],result[14])
            aL10,bL10 = intervalle_confiancebis(Leftmean10,result[9],min(nbdays,10))
            aR,bR = intervalle_confiance(result[10],result[11],result[14])
            aR10,bR10 = intervalle_confiancebis(Rightmean10,result[13],min(nbdays,10))
            rhwmny = dataline[7]
            lhwmny = dataline[6]

        if nbdays >= 10:
            Leftmean10.pop(0)
            Rightmean10.pop(0)
            Leftmean10.append(dataline[6])
            Rightmean10.append(dataline[7])
            Lmean = result[6]
            Lmean = Lmean*(nbdays/(nbdays+1)) + dataline[6]/(nbdays)
            Rmean = result[10]
            Rmean = Rmean*(nbdays/(nbdays+1)) + dataline[7]/(nbdays)
            Lstdev,Rstdev = result[7],result[11]

            add = (dataline[6] - Lmean)
            Lstdev = sqrt(Lstdev*Lstdev + (add*add))
            add = (dataline[7] - Rmean)
            Rstdev = sqrt(Rstdev*Rstdev + (add*add))
            mean = (sum(Leftmean10)/min(10,nbdays))
            meansquare = mean*mean

            othermean = (sum([i*i for i in Leftmean10])/min(10,nbdays))
            Lstdev10 = othermean - meansquare

            mean = (sum([int(i) for i in Rightmean10])/min(10,nbdays))
            meansquare = mean*mean

            othermean = (sum([i*i for i in Rightmean10])/min(10,nbdays))
            Rstdev10 = othermean - meansquare

            nbdays +=1

            Leftmean10 = json.dumps(result[8])
            Rightmean10 = json.dumps(result[12])
            print(Leftmean10)

            cursor2.execute("""UPDATE {} SET Leftmean = ?, 
                   Leftstdev = ?, 
                   Leftmean10 = ?, 
                   Leftstdev10 = ?, 
                   Rightmean = ?, 
                   Rightstdev = ?, 
                   Rightmean10 = ?, 
                   Rightstdev10 = ?, 
                   nbdays = ?   WHERE (timestp = ?  AND idq = ? 
                   AND idz = ? 
                   AND portq = ? 
                   AND portz = ? 
                   AND prot = ?);""" .format(name3), (Lmean,Lstdev,Leftmean10,Lstdev10,Rmean,Rstdev,Rightmean10,Rstdev10,nbdays,result[0],result[1],result[2],result[3],result[4],result[5]))

    conn.commit()
    conn2.commit()
    conn.close()
    conn2.close()
    bla= "it works"

    return(bla)    

When i launch it for the first time (base "name3" created but empty), the condition "if result = None" is always verified, and the database is correctly filled.  Especially, my list is successfully stocked, using the function json.dumps(mylist)
The problem happens while processing a second time : the block
print(result[8])
Leftmean10 = json.loads(result[8])
print(Leftmean10)
Rightmean10 = json.loads(result[12])
print(type(Leftmean10))

returns
"[69]"
[69]
<class 'str'>

I furthermore get later errors because of this 'str' type. 
I don't understand what is happening.  The json.loads function should returns a list, doesn't it ?  And that's what it seems to do : print(Leftmean10) returns me [69]and not "[69]", except.. It's for the program still a string ^^
Thank you in advance for answers ! 

A:

Your string result[8] actually contains the double quote characters in them:
>>> print('[69]')
[69]
>>> print('"[69]"')
"[69]"

Inside json.loads this is correctly converted to the string "[69]".  One way to fix this is by removing these two double quotes:
json.loads(result[8][1:-1])

