Skip to content

Instantly share code, notes, and snippets.

View varunpant's full-sized avatar

Varun varunpant

View GitHub Profile
@varunpant
varunpant / autocomplete-redis-python.py
Created May 6, 2012 21:30
Redis autocomplete example in python (Port of Antirez)
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
# Create the completion sorted set
if r.exists('compl') == False:
print "Loading entries in the Redis DB\n"
f = open('female-names.txt',"r")
for line in f:
n = line.strip()