title: Kivy: how to instantiate a dynamic classes in python
body: <p>I'm having a hard time trying to figure out how to instantiate a dynamic class I created using kv lang on my python code, consider the following code:</p>
  
  <p>My test.kv file looks like this:</p>
  
  <pre><code>&lt;MyPopup@Popup&gt;:
      title:'hello'
      size_hint:(1, .6)
      GridLayout:
          id:root_grid
          cols:2
          padding:['8dp', '4dp','8dp','4dp']
          spacing:'8dp'
          Label:
              text:'some text here'
          Button:
              text:'Ok'
              on_press:do_something()
  &lt;MyGrid&gt;:
      rows:1
      Button:
          text:'Show Popup'
          on_press:root.pop.show()
  </code></pre>
  
  <p>Then in my test.py:</p>
  
  <pre><code>from kivy.app               import App
  from kivy.uix.gridlayout    import GridLayout
  from kivy.uix.floatlayout   import FloatLayout
  from kivy.uix.popup         import Popup
  from kivy.factory           import Factory
  
  class MyGrid(GridLayout):
      pop = Factory.MyPopup()
      pass
  
  class Test(App):
      def build(self):
          return MyGrid()
  
  if __name__=='__main__':
      Test().run()
  </code></pre>
  
  <p>The I get the following error: raise FactoryException('Unkown class &lt;%s>' % name) kivy.factory.FactoryException: Unkown class </p>
  
  <p>Can somebody please explain me how to properly do it, what am I missing? If you need any more information please let me know. Thanks.</p>