Skip to content

Python example

Josh Baker edited this page May 30, 2018 · 6 revisions

python_redis project page

Install

pip install redis

Example

All Tile38 commands should be sent using the client.execute_command(command) function.

import redis
def test_tile38():
    client = redis.Redis(host='127.0.0.1', port=9851)
    # insert data
    result = client.execute_command('SET', 'fleet', 'truck', 'POINT', 33.32, 115.423)
    # print result
    print result
    # get data
    print client.execute_command('GET', 'fleet', 'truck')

if __name__ == '__main__':
    test_tile38()

Thanks to @beyoung for providing this example code

Clone this wiki locally