This repository has been archived by the owner on Aug 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.py
154 lines (149 loc) · 4.18 KB
/
commands.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import time
import random
from main_ideas import *
from personality_ideas import *
from gimmick_ideas import *
class commands:
def add():
print('\n-----\nArguments:\n[Main, Personality, Gimmick]\n')
print('Example: "Robot, Cheerful, Obsessive"' )
i=str(input("What do you want to add?\nDon't forget to add ','\nType CANCEL to cancel!\nType NONE to not add an argument!\n\n"))
stop=False
if 'cancel' in i.lower():
print("\nCanceling!\n")
return
i=i.split(", ")
try:
print(f'arguments:\n{i[0]} {i[1]} {i[2]}')
except:
print("\nError!\n")
return
if "none" in i[0].lower():
stop=True
main=open('main_ideas.py', 'r+')
data=main.read()
if i[0].lower() in data.lower():
print("No duplicates! I found a duplicate in the main ideas!\n")
else:
main.close()
main=open('main_ideas.py', 'w')
if stop==False:
main.write(f"{data[:-1]}, '{i[0]}']")
if stop==True:
main.write(data)
main.close()
print("\nAll done!\n")
stop=False
if "none" in i[1].lower():
stop=True
main=open('personality_ideas.py', 'r+')
data=main.read()
if i[1].lower() in data.lower():
print("No duplicates! I found a duplicate in the Personality ideas!\n")
else:
main.close()
main=open('personality_ideas.py', 'w')
if stop==False:
main.write(f"{data[:-1]}, '{i[1]}']")
if stop==True:
main.write(data)
main.close()
print("\nAll done!\n")
stop=False
if "none" in i[2].lower():
stop=True
main=open('gimmick_ideas.py', 'r+')
data=main.read()
if i[2].lower() in data.lower():
print("No duplicates! I found a duplicate in the Gimmick ideas!\n")
else:
main.close()
main=open('gimmick_ideas.py', 'w')
if stop==False:
main.write(f"{data[:-1]}, '{i[2]}']")
if stop==True:
main.write(data)
main.close()
print("\nAll done!\n")
def view():
print(f'\n-----\nVisible values are:\n1. main_ideas\n2. personality_ideas\n3. gimmick_ideas')
try:
i=input(f'What would you like to view? ')
except:
print("Uh oh! An error happened! Maybe you didn't put a number?")
if i=='1':
value="main_ideas.py"
elif i=='2':
value="personality_ideas.py"
elif i=='3':
value="gimmick_ideas.py"
else:
print("\nError! Wrong number!\n")
return
main=open(value, "r")
data=main.read()
if 'main_ideas=[' in data:
start=12
if 'personality_ideas=[' in data:
start=19
if 'gimmick_ideas=[' in data:
start=15
print(f'\nValues are:')
data=data[start:-1]
for x in data.split(', '):
print(x)
time.sleep(1)
def gen():
print(f'\n-----\nGenerating!')
time.sleep(1.3)
main=0
for x in main_ideas:
main=main+1
per=0
for x in personality_ideas:
per=per+1
gim=0
for x in gimmick_ideas:
gim=gim+1
main=random.randint(0, main-1); per=random.randint(0, per-1); gim=random.randint(0, gim-1)
print(main, per, gim)
print(f'Main: {main_ideas[main]}\nPersonality: {personality_ideas[per]}\nGimmick: {gimmick_ideas[gim]}\n')
def genmult():
try:
i=int(input("\n-----\nHow many ideas would you like to generate?\n(NUMBERS ONLY, MAX OF 10)\n"))
except:
print('\nError! Did you put a number in?\n')
return
print(f'\n-----\nGenerating!')
time.sleep(1.3)
if i >=11:
print("No more than 10 at a time...")
return
while i>0:
time.sleep(0.5)
main=0
for x in main_ideas:
main=main+1
per=0
for x in personality_ideas:
per=per+1
gim=0
for x in gimmick_ideas:
gim=gim+1
main=random.randint(0, main-1); per=random.randint(0, per-1); gim=random.randint(0, gim-1)
print(main, per, gim)
print(f'Main: {main_ideas[main]}\nPersonality: {personality_ideas[per]}\nGimmick: {gimmick_ideas[gim]}\n')
i=i-1
print("All done!")
time.sleep(3)
def option(i):
if i=='1':
commands.add()
elif i=='2':
commands.view()
elif i=='3':
commands.gen()
elif i=='4':
commands.genmult()
else:
print("\nError!\n")