#!/bin/python3.11 import sys import random import argparse import datetime def main(): #argument parsing parg = argparse.ArgumentParser(prog='randtest', description='generates random butes', ) parg.add_argument('-n', '--nbytes', type=int, help='number of bytes to write', default=100) parg.add_argument('-f', '--file', help='file name to write to', default='test') args = parg.parse_args() fname = args.file nbytes = args.nbytes #random random.seed(datetime.datetime.now().microsecond) #file open in byte mode f = open(fname, 'wb') #write the file f.write(random.randbytes(nbytes)) #close the file f.close() main()