Advertisement
Omnifarious

Generating compressor test data

Apr 1st, 2024 (edited)
1,652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | Software | 0 0
  1. import itertools, random
  2. pl = [''.join(p) for p in itertools.permutations([chr(65 + x) for x in range(11)])]
  3. sections = set()
  4. while len(sections) < 3500:
  5.     sections.add(random.randint(0, 480924 * 83))
  6. sectstrs = ['\n'.join(pl[x:x+83]) for x in sections]
  7. with open('permutes.txt', 'w') as pf:
  8.     for _ in range(19):
  9.         random.shuffle(sectstrs)
  10.         pf.write('\n'.join(sectstrs) + '\n')
Tags: Compression
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement