Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: UTF-8 -*-
- import xml.etree.ElementTree as ET
- import sqlite3
- #open a database connection to the database translateDB.sqlite
- conn = sqlite3.connect('translateDB.sqlite')
- #prepare a cursor object using cursus() method
- cursor = conn.cursor()
- #test input
- # this doesn't work
- text = ('Hiper-radiação simétrica periocular bem delimitada, homogênea')
- # this does work in english
- #text = ('Well delimited, homogeneous symmetric periocular hyper- radiation.')
- # Execute SQL query using execute() method.
- cursor.execute('SELECT * FROM translate WHERE L2_portugese=?', (text,))
- # Fetch a single row using fetchone() method and display it.
- print cursor.fetchone()
- # Disconnect from server
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement