add2db.py
author viric <viriketo@gmail.com>
Sun, 13 Feb 2011 08:11:31 +0100
changeset 3 01dafa022fa1
parent 0 6371497b4e53
permissions -rwxr-xr-x
Fre que llegeixi un fitxer de paraules
#!/usr/bin/python
# -*- coding: utf-8 -*-


import sys,shelve

dbase = shelve.open('vortoj-ru-ca.sdb')

print "Showing keys:"
for a in dbase.keys():
	print a

print("Tajpu vorton por aldoni al la listo:"),
key = raw_input()

if key == "":
	print "Fino."
	sys.exit()

print("Tajpu tradukon por %s:" % key),
traduko = raw_input()

dbase[key] = traduko

print "Showing new keys:"
for a in dbase.keys():
	print a
dbase.close()