Download cpython_2/environment/repo/Doc/includes/sqlite3/execute_1.py from lolbench26/LoLBench: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Doc/includes/sqlite3/execute_1.py
- Command line
-
hf download hf://datasets/lolbench26/LoLBench/cpython_2/environment/repo/Doc/includes/sqlite3/execute_1.py
-
curl -L -o execute_1.py https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Doc/includes/sqlite3/execute_1.py
399 Bytes
| import sqlite3 | |
| con = sqlite3.connect(":memory:") | |
| cur = con.cursor() | |
| cur.execute("create table people (name_last, age)") | |
| who = "Yeltsin" | |
| age = 72 | |
| # This is the qmark style: | |
| cur.execute("insert into people values (?, ?)", (who, age)) | |
| # And this is the named style: | |
| cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age}) | |
| print(cur.fetchone()) | |
| con.close() | |