-
Notifications
You must be signed in to change notification settings - Fork 22
Home
tmaesaka edited this page May 4, 2011
·
3 revisions
Introduction goes here.
from kyototycoon import KyotoTycoon
kt = KyotoTycoon()
kt.open()
kt.set('key', 'abc')
value = kt.get('key')
kt.close()
By default, python-kyototycoon connects to the localhost on port 1978 (default port of Kyoto Tycoon). Alternatively, you can choose to connect to a server of your choice when you open a new connection.
kt.open(HOSTNAME, PORT_NUMBER)
Additionally, you can choose to specify a timeout (in seconds).
kt.open(HOSTNAME, PORT_NUMBER, TIMEOUT)
By default, python-kyototycoon serializes data using the Python picke module. This means that by default, data sent over the wire / stored on Kyoto Tycoon can (generally) only be processed by Python. In order to achieve data interoperability, you can choose to use the optional JSON serializer or override the seralizer yourself. This functionality is currently in progress.