-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.py
More file actions
38 lines (32 loc) · 1.14 KB
/
Copy pathinterface.py
File metadata and controls
38 lines (32 loc) · 1.14 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
from kivy.app import App
from kivy.config import Config
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from main import Result
class ChatBot(App):
def build(self):
self.title = 'Chat'
chat = BoxLayout(orientation='horizontal')
self.affich = Label(text='', font_size=30)
chat.add_widget(self.affich)
entree = BoxLayout(orientation='horizontal')
self.txt = TextInput(font_size=30, size_hint=(0.7, 0.3))
entree.add_widget(self.txt)
self.btn1 = Button(text='Entrer', font_size=30, size_hint=(0.7, 0.3))
self.btn1.bind(on_press=self.recup)
entree.add_widget(self.btn1)
box = BoxLayout(orientation='vertical')
box.add_widget(chat)
box.add_widget(entree)
return box
def recup(self, btn=None):
str = self.txt.text
res = Result()
self.affich.text = res.display_result(str, 1)
return str
Config.set('graphics', 'width', '350')
Config.set('graphics', 'height', '50')
if __name__ == "__main__":
ChatBot().run()