Guest User

Untitled

a guest
Oct 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import sqlite3
  2.  
  3. def insert_data(values):
  4. cursor = sqlite3.connect("somedatabase.db").cursor()
  5. sql = "Insert into Product(Name,Price) values (?,?)"
  6. cursor.execute(sql,values)
  7. sqlite3.connect("somedatabase.db").commit()
  8.  
  9. if __name__ == "__main__":
  10. product = ("Espresso",1.5)
  11. insert_data(product)
Add Comment
Please, Sign In to add comment