install sqlite3 lib ubuntu python code example
Example 1: is sqlite installed as part of python3
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real, price real)''')
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
conn.commit()
conn.close()
Example 2: how to install sqlite3 in python
if you are using python3, sqlite3 is built in into it.
Example 3: how to install sqlite3 in python
$chmod +x sqlite.py
$./sqlite.py
Open database successfully