I’m trying to analyze this wiktionary dump with is 5 gigs but I’m getting the above error message in the title. Here is my code
import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()
sql_file = open(f'wiktionary_categories.sql',encoding = "ISO-8859-1")
sql_as_string = sql_file.read()
c.executescript(sql_as_string)
Is there someway I can use a with statement? such as:
with open(f'wiktionary_categories.sql',encoding = "ISO-8859-1") as sql_file:
sql_as_string = sql_file.read()
c.executescript(sql_as_string)
I just want to run through the file and pick out all of the words which belong to a certain category.