Skip to content

Instantly share code, notes, and snippets.

@hhatto
Created January 30, 2012 13:26
Show Gist options
  • Save hhatto/1704380 to your computer and use it in GitHub Desktop.
Save hhatto/1704380 to your computer and use it in GitHub Desktop.
groongaql example
from groongaql import Context, ENC_DEFAULT, SUCCESS
"""groongaql test scrip
1. groonga -s
2. python script.py
"""
def main():
ctx = Context(flags=0, encoding=ENC_DEFAULT)
ret = ctx.ql_connect(host="0.0.0.0", port=10041, flags=0)
if SUCCESS != ret:
print "ERR"
return 0
print "connect success!!"
print ctx.ql_send("status", flags=0)
print ctx.ql_recv()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment