summaryrefslogtreecommitdiffstats
path: root/recipes-test/big-update/files/rand_file.py
blob: 0f4f16e4ec0fa664bc63a2af506356212745e5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys
from random import seed, randint

def main():
    n = int(sys.argv[2])
    ba = bytearray(n)

    seed(42)
    for i in range(0, n):
       ba[i] = randint(0, 255)

    with open(sys.argv[1], 'wb') as f:
        f.write(bytes(ba))

if __name__ == "__main__":
    main()