2024-04-29 22:49:29 +02:00
|
|
|
from random import randint
|
|
|
|
|
from kivy.uix.boxlayout import BoxLayout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RanNum(BoxLayout):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def generate_random_number(self):
|
|
|
|
|
try:
|
|
|
|
|
upper_boundary = int(self.ids.upper_boundary_input.text)
|
|
|
|
|
self.ids.output.text = str(randint(1, upper_boundary))
|
|
|
|
|
except ValueError:
|
|
|
|
|
self.ids.output.text = 'Bitte nur positive,\nganze Zahlen eingeben!'
|