diff options
Diffstat (limited to 'Doc/includes/sqlite3/execute_2.py')
-rw-r--r-- | Doc/includes/sqlite3/execute_2.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/includes/sqlite3/execute_2.py b/Doc/includes/sqlite3/execute_2.py new file mode 100644 index 0000000..df6c894 --- /dev/null +++ b/Doc/includes/sqlite3/execute_2.py @@ -0,0 +1,12 @@ +import sqlite3 + +con = sqlite3.connect("mydb") + +cur = con.cursor() + +who = "Yeltsin" +age = 72 + +cur.execute("select name_last, age from people where name_last=:who and age=:age", + {"who": who, "age": age}) +print cur.fetchone() |