Download cpython_2/environment/repo/Doc/includes/sqlite3/rowclass.py from lolbench26/LoLBench: direct link, hf CLI and curl.
- Browser
- Download file 312 Bytes
-
https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Doc/includes/sqlite3/rowclass.py
- Command line
-
hf download hf://datasets/lolbench26/LoLBench/cpython_2/environment/repo/Doc/includes/sqlite3/rowclass.py
-
curl -L -o rowclass.py https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Doc/includes/sqlite3/rowclass.py
312 Bytes
| import sqlite3 | |
| con = sqlite3.connect(":memory:") | |
| con.row_factory = sqlite3.Row | |
| cur = con.cursor() | |
| cur.execute("select 'John' as name, 42 as age") | |
| for row in cur: | |
| assert row[0] == row["name"] | |
| assert row["name"] == row["nAmE"] | |
| assert row[1] == row["age"] | |
| assert row[1] == row["AgE"] | |
| con.close() | |