Last active
October 28, 2015 13:05
-
-
Save lmorillas/09eea757310705718546 to your computer and use it in GitHub Desktop.
Introduce una traducción nueva a una tabla para arasaac
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 csv | |
import MySQLdb | |
conn = ... | |
cur = conn.cursor() | |
reader = csv.reader(open('arasaac_croata.csv')) | |
lineas = [l for l in reader] | |
insert = '''INSERT INTO `traducciones_16` (`id_traduccion`, `id_palabra`, `traduccion`) VALUES (%s, %s, %s)''' | |
ini = 214052 | |
for n, trad in enumerate(lineas[1:]): | |
cur.execute(insert, (n + ini, trad[0], trad[2])) | |
conn.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment