-
Notifications
You must be signed in to change notification settings - Fork 0
sqlite3
jasper-zanjani edited this page Aug 6, 2020
·
1 revision
Create a Connect connection object and employee.db (binary) if it doesn't exist
conn = sqlite.connect('employee.db')Create a Connect.Cursor object
c = conn.cursor()Perform SQL commands with Connect.Cursor.execute(). Create tablename with fields field of type type (null, integer, real, text, blob); never use Python's native string operations (f-strings, etc) to form commands, because this method is vulnerable to SQL injection. YouTube
c.execute('''CREATE TABLE {tablename} ({field} {type}, {field} {type} ...))Save changes
conn.commit()Close connection
conn.close()- argparse ?
- array ?
- asyncio ?
- bisect ?
- csv ?
- ctypes ?
- curses ?
- datetime ?
- functools ?
- getpass ?
- glob ?
- heapq ?
- http ?
- json ?
- logging ?
- optparse ?
- os ?
- pathlib ?
- platform ?
- pythonnet ?
- random ?
- socket ?
- subprocess ?
- sqlite3 ?
- sys ?
- termcolor ?
- threading ?
- trace ?
- typing ?
- unittest ?
- urllib ?
- venv ?
- weakref ?
- winrm ?