Untitled

                Never    
import kivy
from kivy.app import *
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from random import randint

cnt = 0

class MainApp( App ):
	def build( self ):
		ecran = FloatLayout()
		buton_principal = Button( text = "Apasa-ma!", pos = ( 0, 0 ), size_hint = ( .15, .15 ) )
		buton_principal.bind( on_release = self.pune_buton_obisnuit )
		ecran.add_widget( buton_principal )
		return ecran
		
	def pune_buton_obisnuit( self, button ):           
		global cnt
		ecran = button.parent # Adica este ecran, altfel zis, un FloatLayout. Il adaug pe el
		buton_obisnuit = Button( text = str( cnt ), size_hint = (.05, .05 ), pos = ( 300 + randint(10, 200), 300 + randint(10, 200) ) ) 
		buton_obisnuit.bind( on_release = self.pune_buton_obisnuit )        
		cnt = cnt + 1
		ecran.add_widget( buton_obisnuit )
	


	
if __name__== "__main__":
	MainApp().run()

Raw Text