aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader/write-random.py
blob: 6834f3b0e1db19cd0b79f49bf75a2448d4478a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3

import argparse
import os
import sys

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Generate file containing random data')
    parser.add_argument('--output', type=argparse.FileType('wb'), default=sys.stdout, help='Output file')
    parser.add_argument('--length', type=int, default=256, help='Length of file')

    args=parser.parse_args()

    args.output.write(os.urandom(args.length))