Skip to content

Instantly share code, notes, and snippets.

@tamuhey
Created January 6, 2019 08:35
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 tamuhey/0d8770b4f9389d9b2f9960577a4d0b5f to your computer and use it in GitHub Desktop.
Save tamuhey/0d8770b4f9389d9b2f9960577a4d0b5f to your computer and use it in GitHub Desktop.
Random sequence generator in Python
def random_generator(step=None):
step = step or random.randint(1e4, 1e5)
for c in count():
for i in random.sample(range(c*step, (c+1)*step), step):
yield i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment