What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-16 14:15:25
Video playing
import sqlite3 def application(environ, start_response): db = sqlite3.connect('/var/www/html/table.db') db.row_factory = sqlite3.Row cursor = db.cursor() cursor.execute('''SELECT id, video_filename FROM table ORDER BY id DESC''') results = ['<tab... Add solution -
Python 2022-03-12 22:30:36
how to read mysql table in python
import pandas as pd import sqlalchemy # make sure you have installed both mysql & pymysql # root:root is my username and password/default engine = sqlalchemy.create_engine("mysql+pymysql://root:root@localhost/database name", p... Add solution -
Python 2022-01-29 20:36:41
create sqlite database python
import sqlite3 conn = sqlite3.connect('TestDB.db') # You can create a new database by changing the name within the quotes c = conn.cursor() # The database will be saved in the location where your 'py' file is saved # Create table - CLIENTS c.execute(''... Add solution -
SQL 2021-11-22 08:52:21
convert sqlite table to pandas dataframe
import sqlite3 import pandas as pd dat = sqlite3.connect('data.db') query = dat.execute("SELECT * From <TABLENAME>") cols = [column[0] for column in query.description] results= pd.DataFrame.from_records(data = query.fetchall(), columns = ... Add solution -
SQL 2021-11-16 12:49:14
is sqlite installed as part of python3
import sqlite3 conn = sqlite3.connect('example.db') c = conn.cursor() # Create table c.execute('''CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)''') # Insert a row of data c.execute("INSERT INTO stocks V... Add solution -
Python 2021-11-07 18:09:20
how to save form data to database in flask\
# routes.py import sqlite3 as sql from my_app import app from flask import render_template, request # connect to qa_database.sq (database will be created, if not exist) con = sql.connect('qa_database.db') con.execute('CREATE TABLE IF NOT EXISTS tbl_QA ... Add solution