It’s running! Yeah!
This commit is contained in:
24
main.py
Normal file
24
main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from random import randint
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.uix.boxlayout import BoxLayout
|
||||
|
||||
|
||||
class RanNum(BoxLayout):
|
||||
pass
|
||||
|
||||
|
||||
class RanKivApp(App):
|
||||
def build(self):
|
||||
return RanNum()
|
||||
|
||||
def generate_random_number(self):
|
||||
try:
|
||||
upper_boundary = int(self.root.ids.upper_boundary_input.text)
|
||||
self.root.ids.output.text = str(randint(1, upper_boundary))
|
||||
except ValueError:
|
||||
self.root.ids.output.text = 'Bitte nur positive,\nganze Zahlen eingeben!'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
RanKivApp().run()
|
||||
Reference in New Issue
Block a user