-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
62 lines (52 loc) · 1.03 KB
/
app.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
56
57
58
59
60
61
62
import sys
from random import choice
from time import sleep
a = "aiueo"
b = "bcdfghjklmnpqrstvwxyz"
isBulk = False
bulkNum = 1
length = 5
auto = False
if len(sys.argv) > 1:
isBulk = sys.argv[1] == "--bulk"
if isBulk and len(sys.argv) > 2:
bulkNum = int(sys.argv[2])
elif len(sys.argv) == 2:
print("USAGE: --bulk <num>")
exit()
else:
length = int(input("Length (5): ") or 5)
auto = bool(input("Auto drive (false): "))
def suggest(l):
f = "a"
if choice([1,0]):
f += choice(a)
for i in range(l):
if f[-1] in a:
f += choice(b)
else:
f += choice(a)
return f[1:l+1]
if not isBulk:
print("Enter/Return - Get more suggestion")
if not auto and not isBulk:
print("q/ctrl+c - Quit")
elif not isBulk:
print("ctrl+c - Quit")
while bulkNum > 0:
suggestion = suggest(length)
try:
if not auto and not isBulk:
print(suggestion, end="")
inp = input()
if inp == "q":
break
elif auto:
print(suggestion)
sleep(1)
elif isBulk:
print(suggestion)
except KeyboardInterrupt:
break
if isBulk:
bulkNum -= 1