forked from machosaurus/TarotGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (32 loc) · 1.24 KB
/
main.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
import random
import webbrowser
from tarot import get_major_arcana, get_minor_arcana
def check_num(number):
total: int = 0
for n in number:
if not n.isdigit():
return input("Invalid entry. Choose numbers only.\n Pick a number: ")
total += int(n)
return str(total)
def play_tarot():
input(" What is your question?: ")
card = random.randint(0, 77)
if 0 <= card < 22:
link = get_major_arcana(card)
url = "https://labyrinthos.co/blogs/tarot-card-meanings-list/"+link+"-meaning-major-arcana-tarot-card-meanings"
else:
link = get_minor_arcana(card)
url = "https://labyrinthos.co/blogs/tarot-card-meanings-list/"+link+"-meaning-tarot-card-meanings"
webbrowser.open(url)
if __name__ == "__main__":
print("Welcome to the Oracle!")
play_tarot()
while True:
next_question = input("Do you have another question? (y/n):").lower()
if next_question == "y":
play_tarot()
elif next_question == "n":
print("Thank you for consulting the Oracle.\n"
"Blessings on your journey, and remember the power is always within You.\n"
"---------------------------------\n")
break