vendredi 27 mai 2022

Why is python telling me that there's a syntax error in a if statement?

I want to add to a sqlite database the values of a checkbox if that checkbox is clicked. I'm getting a syntax error at the colon of an if statement.

def addtoservices():
    sql = "INSERT INTO serviceoffered VALUES (?)"
    if(s12v.get()==1):
        c.execute(sql, [s12.cget("text")]
    if(s13v.get()==1):
        c.execute(sql, [s13.cget("text")]
    if(s14v.get()==1):
        c.execute(sql, [s14.cget("text")]
    if(s15v.get()==1):
        c.execute(sql, [s15.cget("text")]
    if(s16v.get()==1):
        c.execute(sql, [s16.cget("text")]
    if(s1ev.get()==1):
        c.execute(sql, [s1e.cget("text")]
    if(s2ev.get()==1):
        c.execute(sql, [s2e.cget("text")]
    if(s3ev.get()==1):
        c.execute(sql, [s3e.cget("text")]
    if(s4ev.get()==1):
        c.execute(sql, [s4e.cget("text")]
    if(s5ev.get()==1):
        c.execute(sql, [s5e.cget("text")]



Aucun commentaire:

Enregistrer un commentaire