title: How can I create multiple buttons with Kivy?
body: <p>I am looking for a way to create a row of buttons in kivy. I am fairly new to kivy so this is what I came up with.</p>
  
  <p>My current code is:</p>
  
  <pre><code>class StackGameApp(App):
  
    def build(self):
  
      layout = FloatLayout()
  
      b0 = Button(pos_hint={'x': 0, 'center_y': .1}, size_hint=(.1, .1),text= '0')
      b1 = Button(pos_hint={'x': .1, 'center_y': .1}, size_hint=(.1, .1),text= '1')
      b2 = Button(pos_hint={'x': .2, 'center_y': .1}, size_hint=(.1, .1),text= '2')
      b3 = Button(pos_hint={'x': .3, 'center_y': .1}, size_hint=(.1, .1),text= '3')
      b4 = Button(pos_hint={'x': .4, 'center_y': .1}, size_hint=(.1, .1),text= '4')
      b5 = Button(pos_hint={'x': .5, 'center_y': .1}, size_hint=(.1, .1),text= '5')
      b6 = Button(pos_hint={'x': .6, 'center_y': .1}, size_hint=(.1, .1),text= '6')
      b7 = Button(pos_hint={'x': .7, 'center_y': .1}, size_hint=(.1, .1),text= '7')
      b8 = Button(pos_hint={'x': .8, 'center_y': .1}, size_hint=(.1, .1),text= '8')
      b9 = Button(pos_hint={'x': .9, 'center_y': .1}, size_hint=(.1, .1),text= '9')
      layout.add_widget(b0)
      layout.add_widget(b1)
      layout.add_widget(b2)
      layout.add_widget(b3)
      layout.add_widget(b4)
      layout.add_widget(b5)
      layout.add_widget(b6)
      layout.add_widget(b7)
      layout.add_widget(b8)
      layout.add_widget(b9)
      return layout
  </code></pre>
  
  <p>Which returns a row of buttons at the bottom of the screen labeled 0-9. I will be coding the buttons to return the numbers 0-9, but that hasn't been done yet.</p>
  
  <p>I am almost certain there is a better, easier way of doing this but i just don't know what it is.</p>