Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sqlite basic

import sqlite3
connect = sqlite3.connect('url-nb.db')
cur = connect.cursor()
cur.execute('drop table if exists url')
cur.execute('''create table url (id integer primary key,
                                url text,
                                title text)''')
for line in lines:
    cur.execute('insert into url (url) values (?)', (line.strip(),))
cur.execute('select url from url')
rows = cur.fetchall()
print(len(rows))
print(rows)
Comment

PREVIOUS NEXT
Code Example
Python :: how do i add two matrix and store it in a list in python 
Python :: integration test python 
Python :: Python batch file rename 
Python :: string exercise 
Python :: How to send an image that was sent with a post request to a model for prediction 
Python :: Hide div element using python in Flask 
Python :: Redirecting an old URL to a new one with Flask micro-framework 
Python :: dict python inpmenttion 
Python :: get command line variables python 
Python :: sqlalchemy validation at db level 
Python :: connect labjack to python 
Python :: flask-sqlalchemy inserting a dictionary to a database 
Python :: ring Date and Time Clock 
Python :: found django install path 
Python :: ring Type Hints Library user types 
Python :: how to start spaCy code 
Python :: salamelecus 
Python :: get most recurring element in a list python 
Python :: django create ap 
Python :: pygame mixer channel loop 
Python :: gun in python turtle 
Python :: python making player inventory 
Python :: arrays with name instead of index python 
Python :: delete history django simple 
Python :: macos youtube-dl unable to get local issuer certificate _ssl.c:1131 
Python :: 1038 solution python 
Python :: pyplot common labels 
Python :: put in something meaning 
Python :: 1046 uri solution 
Python :: break statement python 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =