$ sudo apt-get install python-sqlite Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libsqlite0 Suggested packages: python-sqlite-dbg The following NEW packages will be installed: libsqlite0 python-sqlite 0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded. Need to get 141 kB of archives. After this operation, 519 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsqlite0 armhf 2.8.17-12 [119 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-sqlite armhf 1.0.1-11 [21.3 kB] Fetched 141 kB in 1s (95.8 kB/s) Selecting previously unselected package libsqlite0. (Reading database ... 137326 files and directories currently installed.) Preparing to unpack .../libsqlite0_2.8.17-12_armhf.deb ... Unpacking libsqlite0 (2.8.17-12) ... Selecting previously unselected package python-sqlite. Preparing to unpack .../python-sqlite_1.0.1-11_armhf.deb ... Unpacking python-sqlite (1.0.1-11) ... Setting up libsqlite0 (2.8.17-12) ... Setting up python-sqlite (1.0.1-11) ... Processing triggers for libc-bin (2.19-18+deb8u7) ...
pi@raspberrypi:~ $ cd src pi@raspberrypi:~/src $ ll total 2060 drwxr-xr-x 2 pi pi 4096 Mar 30 14:40 . drwxr-xr-x 30 pi pi 4096 Mar 30 14:34 .. -rw-r--r-- 1 pi pi 2099200 Mar 29 12:29 sqlite.udb
pi@raspberrypi:~/src $ python Python 2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> conn = sqlite3.connect('sqlite.udb') >>> c = conn.cursor() >>> c.execute("select * from tbl_recv") <sqlite3.Cursor object at 0x769eaa20> |