Friday, 15 July 2011

python - Error encountered while using the SQL Module -


I am trying to create a table using SQL and entering some values ​​

  import sqlite3 conn = "Sqlite3.connect" c = conn.cursor () score 1 = 5 score 2 = 5 score 3 = 5 name = ("brad") class = 2def table (): C.execute (("Create table class {} (name text, score 1 INT, score 2 INT, score 3 INT)"). Format (class)) DIF DataInterror (): c. Price (class), (name, score 1, score 2, score 3). Format (class)) conn.commit (("INSERT INTO class {} (name, score 1, score 2, score 3)  

I encounter data entry ()

  in the data entry in line 13 (name, score1, score2, score 3) .format (class) ) Attribute error: There is no attribute 'format' in 'Tulle' object < 

Calling the form on the query string only , the leg of the foot Not at the meter:

  c.execute ("INSERT INTO class {} (name, score1, score) (Score: 2, score 3) value (?,?,?,?) Format (class), (name, score 1, score 2, score 3)) Maybe the brackets around the wire confuse you; They were unnecessary and I removed them too. . 


No comments:

Post a Comment