-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverson-3.py
366 lines (320 loc) · 15.2 KB
/
verson-3.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
import customtkinter as ctk
import datetime
import time
import threading
from tkinter import messagebox
# Configure appearance
ctk.set_appearance_mode("light")
ctk.set_default_color_theme("green")
class NumerologyProApp(ctk.CTk):
def __init__(self):
super().__init__()
# Window configuration
self.title("🔮 Numerology Pro 3.0")
self.geometry("800x900")
self.configure(fg_color="#FFF0F5")
# Configure grid
self.grid_columnconfigure(0, weight=1)
# Numerology data
self.load_resources()
self.history = []
# Create widgets
self.create_widgets()
def load_resources(self):
"""Load numerology meanings and aspect details."""
self.aspects = {
'life_path': {
'title': "Life Path Number 🌟",
'color': "#FF69B4",
'icon': "🌟"
},
'destiny': {
'title': "Destiny Number 🎯",
'color': "#4B0082",
'icon': "🎯"
},
'soul': {
'title': "Soul Urge Number 💖",
'color': "#FF4500",
'icon': "💖"
},
'personality': {
'title': "Personality Number 🦄",
'color': "#00BFFF",
'icon': "🦄"
},
'birthday': {
'title': "Birthday Number 🎂",
'color': "#32CD32",
'icon': "🎂"
}
}
self.meanings = {
'life_path': {
"1": "Natural leader, independent, pioneering",
"2": "Cooperative, diplomatic, intuitive",
"3": "Creative, expressive, optimistic",
"4": "Practical, disciplined, hard-working",
"5": "Adventurous, freedom-loving, adaptable",
"6": "Nurturing, responsible, community-focused",
"7": "Analytical, truth-seeking, spiritual",
"8": "Ambitious, business-minded, powerful",
"9": "Humanitarian, compassionate, artistic",
"11": "Intuitive, inspirational, idealistic",
"22": "Master builder, practical visionary",
"33": "Master teacher, spiritual guide",
"0": "Invalid input - please check your name"
},
'destiny': {
"1": "Leadership, independence, and innovation",
"2": "Cooperation, harmony, and diplomacy",
"3": "Creativity, self-expression, and joy",
"4": "Stability, hard work, and practicality",
"5": "Freedom, adventure, and versatility",
"6": "Responsibility, nurturing, and balance",
"7": "Introspection, spirituality, and wisdom",
"8": "Ambition, success, and material wealth",
"9": "Humanitarianism, compassion, and idealism",
"11": "Inspiration, intuition, and spiritual insight",
"22": "Mastery, large-scale projects, and practical vision",
"33": "Spiritual guidance, healing, and universal love"
},
'soul': {
"1": "Desire for independence and leadership",
"2": "Desire for harmony and partnership",
"3": "Desire for creativity and self-expression",
"4": "Desire for stability and security",
"5": "Desire for freedom and adventure",
"6": "Desire for love and nurturing",
"7": "Desire for knowledge and spiritual growth",
"8": "Desire for success and material abundance",
"9": "Desire to serve humanity and make a difference",
"11": "Desire for spiritual enlightenment and inspiration",
"22": "Desire to achieve large-scale goals and make a lasting impact",
"33": "Desire to heal and uplift humanity through love"
},
'personality': {
"1": "Confident first impression",
"2": "Warm and approachable demeanor",
"3": "Friendly and creative personality",
"4": "Serious and practical appearance",
"5": "Adventurous and energetic vibe",
"6": "Caring and responsible nature",
"7": "Mysterious and intellectual aura",
"8": "Powerful and authoritative presence",
"9": "Compassionate and idealistic image"
},
'birthday': {
"1": "Natural leader with strong willpower",
"2": "Peacemaker with great sensitivity",
"3": "Creative communicator and optimist",
"4": "Practical builder with strong values",
"5": "Freedom-loving adventurer",
"6": "Nurturing caregiver and problem-solver",
"7": "Analytical thinker and truth-seeker",
"8": "Ambitious achiever with business acumen",
"9": "Compassionate humanitarian",
"11": "Inspirational visionary with heightened intuition",
"22": "Master architect of large-scale projects",
"33": "Spiritual guide focused on universal love"
}
}
def create_widgets(self):
"""Create all GUI widgets."""
# Header
self.header = ctk.CTkFrame(self, fg_color="transparent")
self.header.grid(row=0, column=0, pady=20)
self.title_label = ctk.CTkLabel(self.header,
text="Numerology Pro 2.0 🔮",
font=("Arial Rounded MT Bold", 28),
text_color="#4B0082")
self.title_label.grid(row=0, column=0, pady=10)
# Input Section
input_frame = ctk.CTkFrame(self, fg_color="transparent")
input_frame.grid(row=1, column=0, pady=20)
# Name Entry
self.name_entry = ctk.CTkEntry(input_frame,
placeholder_text="Full Name",
width=300,
height=40,
font=("Arial", 14),
border_color="#FFB6C1")
self.name_entry.grid(row=0, column=0, padx=10, pady=10)
# Date Entry
self.date_entry = ctk.CTkEntry(input_frame,
placeholder_text="DD/MM/YYYY",
width=300,
height=40,
font=("Arial", 14),
border_color="#FFB6C1")
self.date_entry.grid(row=0, column=1, padx=10, pady=10)
# Calculate Button
self.calculate_btn = ctk.CTkButton(input_frame,
text="Analyze My Numerology 🌈",
command=self.start_calculation,
width=200,
height=40,
fg_color="#9370DB",
hover_color="#663399",
font=("Arial", 14, "bold"))
self.calculate_btn.grid(row=1, column=0, columnspan=2, pady=20)
# Loading Animation
self.loading_label = ctk.CTkLabel(input_frame, text="", font=("Arial", 14))
self.loading_label.grid(row=2, column=0, columnspan=2, pady=10)
# Results Notebook
self.tabs = ctk.CTkTabview(self, width=700, height=500,
fg_color="#FFFFFF", segmented_button_selected_color="#FF69B4")
self.tabs.grid(row=2, column=0, pady=20)
for aspect in self.aspects:
self.tabs.add(self.aspects[aspect]['title'])
self.create_aspect_tab(aspect)
# History Section
self.history_frame = ctk.CTkScrollableFrame(self, width=700, height=200,
fg_color="#FFFFFF")
self.history_frame.grid(row=3, column=0, pady=20)
self.history_label = ctk.CTkLabel(self.history_frame, text="Recent Readings 📚",
font=("Arial", 12, "bold"))
self.history_label.pack(pady=10)
def create_aspect_tab(self, aspect):
"""Create content for each tab."""
tab = self.tabs.tab(self.aspects[aspect]['title'])
tab.grid_columnconfigure(0, weight=1)
# Title Label
title_label = ctk.CTkLabel(tab,
text=self.aspects[aspect]['title'],
font=("Arial Rounded MT Bold", 20),
text_color=self.aspects[aspect]['color'])
title_label.grid(row=0, column=0, pady=10)
# Number Label
number_label = ctk.CTkLabel(tab,
text="Number: -",
font=("Arial", 18, "bold"),
text_color="#4B0082")
number_label.grid(row=1, column=0, pady=5)
# Icon Label
icon_label = ctk.CTkLabel(tab,
text=self.aspects[aspect]['icon'],
font=("Arial", 24))
icon_label.grid(row=2, column=0, pady=5)
# Description Label
description_label = ctk.CTkLabel(tab,
text="Description will appear here...",
font=("Arial", 14),
wraplength=600)
description_label.grid(row=3, column=0, pady=10)
# Store the labels for later updates
setattr(self, f"{aspect}_number_label", number_label)
setattr(self, f"{aspect}_description_label", description_label)
def start_calculation(self):
"""Start the calculation in a separate thread."""
self.calculate_btn.configure(state="disabled")
self.loading_label.configure(text="Calculating... 🔮")
threading.Thread(target=self.calculate_with_loading).start()
def calculate_with_loading(self):
"""Simulate loading and perform calculation."""
try:
# Simulate loading
for i in range(3):
self.loading_label.configure(text=f"Calculating{'.'*(i+1)} 🔮")
time.sleep(0.5)
self.calculate()
except Exception as e:
self.show_error(str(e))
finally:
self.loading_label.configure(text="")
self.calculate_btn.configure(state="normal")
def calculate(self):
"""Perform numerology calculations."""
name = self.name_entry.get().strip()
date_str = self.date_entry.get().strip()
if not name or not date_str:
self.show_error("Please fill in both name and date fields")
return
try:
# Parse the date
birth_date = datetime.datetime.strptime(date_str, "%d/%m/%Y")
# Validate name contains letters
if not any(c.isalpha() for c in name):
self.show_error("Name must contain at least one letter")
return
# Calculate numerology numbers
life_path_number = self.calculate_life_path(birth_date)
destiny_number = self.calculate_destiny(name)
soul_number = self.calculate_soul(name)
personality_number = self.calculate_personality(name)
birthday_number = self.calculate_birthday(birth_date)
# Update the UI with numbers and descriptions
self.update_result('life_path', life_path_number)
self.update_result('destiny', destiny_number)
self.update_result('soul', soul_number)
self.update_result('personality', personality_number)
self.update_result('birthday', birthday_number)
# Add to history
self.history.append(f"{name} - {date_str}")
self.update_history()
except ValueError as e:
self.show_error("Invalid date format. Please use DD/MM/YYYY.")
def update_result(self, aspect, number):
"""Update both number and description for an aspect."""
number_str = str(number)
getattr(self, f"{aspect}_number_label").configure(text=f"Number: {number_str}")
# Get description with fallback
description = self.meanings.get(aspect, {}).get(
number_str,
"Meaning not available for this number"
)
getattr(self, f"{aspect}_description_label").configure(text=description)
def calculate_life_path(self, birth_date):
"""Calculate the Life Path number."""
total = birth_date.day + birth_date.month + birth_date.year
while total > 9 and total not in [11, 22, 33]:
total = sum(map(int, str(total)))
return total
def calculate_destiny(self, name):
"""Calculate the Destiny number."""
name = name.replace(" ", "").lower()
total = sum(ord(char) - 96 for char in name if char.isalpha())
if total == 0:
return 0
while total > 9 and total not in [11, 22, 33]:
total = sum(map(int, str(total)))
return total
def calculate_soul(self, name):
"""Calculate the Soul Urge number."""
vowels = [char for char in name.lower() if char in 'aeiou']
total = sum(ord(char) - 96 for char in vowels)
if total == 0:
return 0
while total > 9 and total not in [11, 22, 33]:
total = sum(map(int, str(total)))
return total
def calculate_personality(self, name):
"""Calculate the Personality number."""
consonants = [char for char in name.lower() if char.isalpha() and char not in 'aeiou']
total = sum(ord(char) - 96 for char in consonants)
if total == 0:
return 0
while total > 9 and total not in [11, 22, 33]:
total = sum(map(int, str(total)))
return total
def calculate_birthday(self, birth_date):
"""Calculate the Birthday number."""
total = birth_date.day
while total > 9:
total = sum(map(int, str(total)))
return total
def update_history(self):
"""Update the history section."""
for widget in self.history_frame.winfo_children():
if widget != self.history_label:
widget.destroy()
for entry in reversed(self.history[-5:]): # Show last 5 entries
entry_label = ctk.CTkLabel(self.history_frame, text=entry, font=("Arial", 12))
entry_label.pack(pady=5)
def show_error(self, message):
"""Show an error message."""
messagebox.showerror("Error", message)
# Run the application
if __name__ == "__main__":
app = NumerologyProApp()
app.mainloop()