import shutil import os import random import sys shutil.rmtree("folder") os.mkdir("folder") xd = int(sys.argv[1]) for i in range(0, xd): f_n = f"folder/{random.randint(0,xd)} - NAME - {random.randint(0,xd)}" with open(f_n, "w") as f: pass