Last active
December 4, 2023 13:07
-
-
Save Arachnid/4b9ddfd439bbef973bada1c39e2ac490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import random | |
import sys | |
def main(): | |
entries = [] | |
entry = '' | |
for line in sys.stdin: | |
if line.startswith('##') and entry != '': | |
entries.append(entry) | |
entry = '' | |
entry = entry + line | |
entries.append(entry) | |
r = random.Random() | |
r.seed('test') | |
r.shuffle(entries) | |
for entry in entries: | |
print(entry) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment