add2db.py
author viric <viriketo@gmail.com>
Mon, 03 Sep 2012 23:35:31 +0200
branchgo
changeset 7 d5750f4e6e8c
parent 0 6371497b4e53
permissions -rwxr-xr-x
Adding a first attempt at go code
#!/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()