示例#1
0
 All content is derived from public domain, promotional, or otherwise-compatible
 sources and published uniformly under the
 Creative Commons Attribution-Share Alike 3.0 license.
 
 See license.README for details.
 
 (C) Neil Tallim, 2009
"""
import os
import sqlite3
import sys

import _db

print "SQLite database expected as first argument...",
mysql_db = _db.getConnection()
mysql_cur = mysql_db.cursor()
sqlite_db = sqlite3.connect(sys.argv[1])
sqlite_cur = sqlite_db.cursor()
print "found"

try:
	print "Updating hymmnos..."
	sqlite_cur.execute("SELECT word, meaning, japanese, dialect, kana, romaji, description, class, syllables FROM hymmnos ORDER BY word ASC, dialect ASC")
	while True:
		row = sqlite_cur.fetchone()
		if not row:
			break
			
		(word, meaning, japanese, dialect, kana, romaji, description, class, syllables) = row
		mysql_cur.execute("SELECT meaning, description, japanese FROM hymmnos WHERE word = %s AND dialect = %s", (word, dialect,))
示例#2
0
Legal
=====
 All code, unless otherwise indicated, is original, and subject to the terms of
 the GNU GPLv3 or, at your option, any later version of the GPL.
 
 All content is derived from public domain, promotional, or otherwise-compatible
 sources and published uniformly under the
 Creative Commons Attribution-Share Alike 3.0 license.
 
 See license.README for details.
 
 (C) Neil Tallim, 2009
"""
import _db

db_con = _db.getConnection()
cursor = db_con.cursor()
try:
	while True:
		print "First word:"
		word_1 = raw_input()
		
		print "First dialect:"
		dialect_1 = int(raw_input())
		
		print "Second word:"
		word_2 = raw_input()
		
		print "Second dialect:"
		dialect_2 = int(raw_input())