⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlite_test.py

📁 Harvestman-最新版本
💻 PY
字号:
import sqlite3class Point(object):    def __init__(self, x, y):        self.x, self.y = x, y    def __conform__(self, protocol):        if protocol is sqlite3.PrepareProtocol:            return '%f;%f' % (self.x, self.y)con = sqlite3.connect("test")c = con.cursor()p = Point(5.0, 3.5)c.execute("drop table points")c.execute("create table points (point text)")#cur.execute("select ?", (p,))#print cur.fetchone()[0]c.execute("insert into points values (?)", (p,))c.execute("select * from points")print c.fetchall()c.close()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -