Skip to content

Instantly share code, notes, and snippets.

@RulerOf
Created May 7, 2021 02: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 RulerOf/9c812fbc33b2d43b242d698e0e83d93b to your computer and use it in GitHub Desktop.
Save RulerOf/9c812fbc33b2d43b242d698e0e83d93b to your computer and use it in GitHub Desktop.
Predictable Shuffle with Python
import random
shuffle_key = "QRUzaKNB4V5pparzJWTa"
# Imagine we have a list of images that's 200k items long
frame_list = [*range(1,200000)]
# Shuffle the frame list with the key
random.Random(shuffle_key).shuffle(frame_list)
# Display our result
for x in range(10):
print(frame_list[x])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment