-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
93 lines (76 loc) · 2.12 KB
/
main.py
File metadata and controls
93 lines (76 loc) · 2.12 KB
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
#!/usr/bin/env python3
# Love You App
# GitHub: https://github.com/Kourva/LoveYouApp
#
# This app generates random love you text
# each time 'get love' button pressed
#
# This app can be a good gift :)
# Imports
import random
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.uix.actionbar import ActionBar, ActionView, ActionPrevious
# KV config
with open("main.kv", "r") as kv:
Builder.load_string(kv.read())
# MainMenu screen
class MainMenuScreen(Screen):
# Love you in different languages
love_texts = [
"Je t’aime\n",
"Te quiero\n",
"ani ohev otach\n",
"Ich liebe dich\n",
"Volim te\n",
"Ti amo\n",
"Eu te amo\n",
"Jag älskar dig\n",
"Te iubesc\n",
"I love you\n",
"Ek he jou lief\n",
"Te dua\n",
"Ana behibek\n",
"Yes kex sirumem\n",
"Ngo oiy ney a\n",
"Doset daram\n",
"Mahal kita\n",
"Mina rakastan sinua\n",
"Aishiteru or Anata ga daisuki desu\n",
"Seni Seviyorum\n",
"Phom rak khun\n",
"Lu`bim ta\n",
"Ya tebya liubliu\n",
"Te iubesc\n",
"Eg elski teg\n",
"люблю тебя\n",
"Ma armastan sind\n",
"Afgreki’\n",
]
# Say love method
def say_love(self, result):
# Result text
prev = result.text
# New text
temp = random.choice(MainMenuScreen.love_texts)
# Add new text to result
result.text = prev + temp
# Main class
class LoveYouApp(App):
# Build method
def build(self):
# Root screen
root = ScreenManager()
# Main menu screen
self.MainMenuScreen = MainMenuScreen(name="MainMenu")
root.add_widget(self.MainMenuScreen)
# Set current screen to main menu and return root
root.current = "MainMenu"
return root
# Run App
LoveYouApp().run()