add2db.py
changeset 0 6371497b4e53
equal deleted inserted replaced
-1:000000000000 0:6371497b4e53
       
     1 #!/usr/bin/python
       
     2 # -*- coding: utf-8 -*-
       
     3 
       
     4 
       
     5 import sys,shelve
       
     6 
       
     7 dbase = shelve.open('vortoj-ru-ca.sdb')
       
     8 
       
     9 print "Showing keys:"
       
    10 for a in dbase.keys():
       
    11 	print a
       
    12 
       
    13 print("Tajpu vorton por aldoni al la listo:"),
       
    14 key = raw_input()
       
    15 
       
    16 if key == "":
       
    17 	print "Fino."
       
    18 	sys.exit()
       
    19 
       
    20 print("Tajpu tradukon por %s:" % key),
       
    21 traduko = raw_input()
       
    22 
       
    23 dbase[key] = traduko
       
    24 
       
    25 print "Showing new keys:"
       
    26 for a in dbase.keys():
       
    27 	print a
       
    28 dbase.close()