add2db.py
author viric <viriketo@gmail.com>
Sun, 13 Feb 2011 22:51:39 +0100
changeset 6 66becdcbe5d9
parent 0 6371497b4e53
permissions -rwxr-xr-x
Ara em va allò dels events
#!/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()