SHARE
TWEET

Untitled

a guest Nov 20th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sqlite3
  2.  
  3. conn = sqlite3.connect("computer_cards.db")
  4.  
  5. create_sql = "CREATE TABLE IF NOT EXISTS first (player1, player2)"
  6. conn.execute(create_sql)
  7. conn.commit
  8.  
  9. insert_sql = "INSERT INTO first(player1, player2) VALUES ('{}','{}')".\
  10.              format('Joe','')
  11. conn.execute(insert_sql)
  12. conn.commit
  13.  
  14. res = conn.execute("SELECT * FROM first")
  15. res_list = res.fetchall()
  16. print(res_list)
  17.  
  18. conn.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top