Created
February 9, 2018 03:04
-
-
Save dews/5202e680fcfaf8da072f5e8d8f08d642 to your computer and use it in GitHub Desktop.
Fill the SQLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
conn = sqlite3.connect('testDB.db') | |
cursor = conn.cursor() | |
# cursor.execute('''CREATE TABLE test5 | |
# (ID INT PRIMARY KEY NOT NULL, | |
# NAME TEXT NOT NULL);''') | |
with open('1mb.img') as f: | |
readFile = f.read() | |
i = 11 | |
while i < 1000: | |
cursor.execute('''INSERT INTO test5 VALUES (?, ?)''',(i, readFile)) | |
conn.commit() | |
i = i + 1 | |
print(conn.total_changes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ fallocate -l 1M 1mb.img