Skip to content

Instantly share code, notes, and snippets.

@kristoff-it
Last active April 7, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristoff-it/5a9ff2808c8ab7bf0a453669f5b79cec to your computer and use it in GitHub Desktop.
Save kristoff-it/5a9ff2808c8ab7bf0a453669f5b79cec to your computer and use it in GitHub Desktop.
$ redis-cli hset vec:1 x 10 y 5 z 23
$ redis-cli hset vec:2 x 2 y 5 z 5
$ python3
>>> import redis
>>> r = redis.Redis(decode_responses=True) # decode_responses is useful in py3
>>> script = open("path/to/script.py", 'r').read()
>>> r.execute_command("RG.PYEXECUTE", script)
[['14.0', '5.0', '6.0'], []]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment