Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. # -*- coding: UTF-8 -*-
  2.  
  3. import xml.etree.ElementTree as ET
  4. import sqlite3
  5.  
  6. #open a database connection to the database translateDB.sqlite
  7. conn = sqlite3.connect('translateDB.sqlite')
  8.  
  9. #prepare a cursor object using cursus() method
  10. cursor = conn.cursor()
  11.  
  12. #test input
  13. # this doesn't work
  14. text = ('Hiper-radiação simétrica periocular bem delimitada, homogênea')
  15.  
  16. # this does work in english
  17. #text = ('Well delimited, homogeneous symmetric periocular hyper- radiation.')
  18.  
  19. # Execute SQL query using execute() method.
  20. cursor.execute('SELECT * FROM translate WHERE L2_portugese=?', (text,))
  21.  
  22. # Fetch a single row using fetchone() method and display it.
  23. print cursor.fetchone()
  24.  
  25. # Disconnect from server
  26. conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement