Skip to content

Instantly share code, notes, and snippets.

@spooky
Created November 2, 2017 20:26
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 spooky/896453e8032dc9de184500e120db3a37 to your computer and use it in GitHub Desktop.
Save spooky/896453e8032dc9de184500e120db3a37 to your computer and use it in GitHub Desktop.
#! /usr/bin/python
import sys
def generate(count=10):
def msg(key, value):
return '*3\r\n$3\r\nSET\r\n${}\r\n{}\r\n${}\r\n{}\r\n'.format(len(key), key, len(value), value)
for i in range(count):
sys.stdout.write(msg('key:{}'.format(i), 'value_{}'.format(i)))
if __name__ == '__main__':
generate(int(sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment