-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.py
55 lines (39 loc) · 1.6 KB
/
gen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Bruteforce all possible name combonations for folders and create them.
Author: PiggyAwesome
"""
from math import trunc
import random
import os
import glob
where = "Folders/" # Where to create folders
e = open("existing_files.txt", "r") # Open separately to make sure there is no confusion.
f = open("existing_files.txt", "a") #
current = e.read().splitlines()
os.chdir(where)
e.close()
num = glob.glob("*").__len__()
num2 = 000000
num3 = 000000
while True:
try:
a = random.choice("abcdefghijklmnopqrstuvwxyz0123456789 "); b = random.choice("abcdefghijklmnopqrstuvwxyz0123456789 "); c = random.choice("abcdefghijklmnopqrstuvwxyz0123456789 "); d = random.choice("abcdefghijklmnopqrstuvwxyz0123456789 ")
if f"{a}{b}{c}{d}" not in current:
os.mkdir(f"{a}{b}{c}{d}")
num += 1
print(f"#{num} {True} ---{a}{b}{c}{d}--- {True}") # Comment this for faster, less satisfying results
f.write(f"{a}{b}{c}{d}\n")
current.append(f"{a}{b}{c}{d}")
except FileExistsError:
num2 += 1
print(f"#{num2} {False} ---{a}{b}{c}{d}--- {False}") # Comment this for faster, less satisfying results
f.write(f"{a}{b}{c}{d}\n")
current.append(f"{a}{b}{c}{d}")
except NotADirectoryError:
num3 += 1
print(f"#{num3} {None} ---{a}{b}{c}{d}--- {None}") # Comment this for faster, less satisfying results
f.write(f"{a}{b}{c}{d}\n")
current.append(f"{a}{b}{c}{d}")
except Exception as error:
print(error)
pass