Skip to content

Instantly share code, notes, and snippets.

@glortho
Created May 14, 2015 18:03
Show Gist options
  • Save glortho/0eb75541f9d5bf584928 to your computer and use it in GitHub Desktop.
Save glortho/0eb75541f9d5bf584928 to your computer and use it in GitHub Desktop.
Random Integer Source
#!/bin/sh
"exec" "twxec" "-e" "rand_ints()" "$0" "$@"
import random
import gevent
def rand_ints():
while True:
value = random.randint({{number minval}}, {{number maxval}} + 1)
yield {"value": value}
gevent.sleep({{number delay}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment