/Doc/includes/sqlite3/execute_1.py

http://unladen-swallow.googlecode.com/ · Python · 11 lines · 7 code · 4 blank · 0 comment · 0 complexity · fa0c856c92b9c95bade3a9e912b73919 MD5 · raw file

  1. import sqlite3
  2. con = sqlite3.connect("mydb")
  3. cur = con.cursor()
  4. who = "Yeltsin"
  5. age = 72
  6. cur.execute("select name_last, age from people where name_last=? and age=?", (who, age))
  7. print cur.fetchone()