add2db.py
author viric <viriketo@gmail.com>
Sun, 13 Feb 2011 07:57:02 +0100
changeset 2 5331bd08a294
parent 0 6371497b4e53
permissions -rwxr-xr-x
Starting a C++ version of the UI
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     1
#!/usr/bin/python
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     2
# -*- coding: utf-8 -*-
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     3
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     4
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     5
import sys,shelve
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     6
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     7
dbase = shelve.open('vortoj-ru-ca.sdb')
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     8
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
     9
print "Showing keys:"
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    10
for a in dbase.keys():
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    11
	print a
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    12
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    13
print("Tajpu vorton por aldoni al la listo:"),
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    14
key = raw_input()
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    15
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    16
if key == "":
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    17
	print "Fino."
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    18
	sys.exit()
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    19
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    20
print("Tajpu tradukon por %s:" % key),
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    21
traduko = raw_input()
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    22
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    23
dbase[key] = traduko
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    24
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    25
print "Showing new keys:"
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    26
for a in dbase.keys():
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    27
	print a
6371497b4e53 Init from svn. The wxpython is the final one.
viric@llimona
parents:
diff changeset
    28
dbase.close()