SQLite is an embedded database, it is a database file. Since SQLite itself is written in C, and the volume is very small, built on the SQLite3 Python, so using SQLite in Python, no need to install anything directly.
Python API interface defines a set of database operations, Python be connected to any database, the database need only provide the drive to meet the standard Python. Since the drive built-in SQLite Python standard library, it can be operated directly SQLite database.
In Python database operation, the database corresponding drive first introduced, and then the Connection object and operation data Cursor object. After the database is finished, make sure to open the Connection object and Cursor objects are closed properly, otherwise it will leak resources.
import sqlite3,os
-
1
-
[( '. 1', 'xiaomaimiao')]
In the end it will generate a folder
lhrtest.db file
And then view the data edit data using data management tools.
So when you need to perform general sql statement execution using the execute method.