title: How to create multiple python file and import them in a single python file in kivy
body: <p>I am developing a game with kivy which has different levels, each level has it own python kivy file. I am using screen manager to move from one screen level to another. The problem is how do I import those python Kivy file containing each level inside the main.py file with kivy. Am not using .kv file.</p>
  <pre><code># level1.py
  
  import kivy
  from kivy.app import App
  from kivy.uix.floatlayout import Floatlayout
  from kivy.uix.widget import Widget
  from kivy.uix.button import Button
  from kivy.label import Label 
  
  
  class Level1(FloatLayout):
      def __init__(self, **kwargs):
          super(Level1, self).__init__(**kwargs)
  
           
          self.btn1=Button(text='level 1', size_hint=(0.5, 0.5), 
          on_press=self.click_b1))
        
       self.add_widget(self.btn1)
          
               
             
          def click_b1(self, instance):
               pass
         
  class Level1App(App):
      def build(self):
          return Level1()
  
  if __name__ == '__main__':
      Level1App().run()
  </code></pre>
  <pre><code># level2.py
  
  import kivy
  from kivy.app import App
  from kivy.uix.floatlayout import Floatlayout
  from kivy.uix.widget import Widget
  from kivy.uix.button import Button
  from kivy.label import Label 
  
  
  class Level2(FloatLayout):
      def __init__(self, **kwargs):
          super(Level2, self).__init__(**kwargs)
  
           
          self.btn1=Button(text='level 2', size_hint=(0.5, 0.5), 
          on_press=self.click_b1))
        
       self.add_widget(self.btn1)
          
               
             
          def click_b1(self, instance):
               pass
         
  class Level2App(App):
      def build(self):
          return Level1()
  
  if __name__ == '__main__':
      Level2App().run()
  </code></pre>
  <p>How do I import level1.py and level2.py inside the main.py which has the screen manager(without .kv)</p>
  <pre><code># main.py with screen manager 
  
  from kivy.app import App
  from kivy.uix.label import Label
  from kivy.uix.button import Button
  from kivy.uix.textinput import TextInput
  from kivy.uix.floatlayout import FloatLayout
  from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
  
  
  class ScreenManagement(ScreenManager):
      def __init__(self, **kwargs):
          super(ScreenManagement, self).__init__(**kwargs)
  
  
  class Level1Window(Screen):
      def __init__(self, **kwargs):
          super(Level1Window, self).__init__(**kwargs)
  
  # run level1.py file here
          
  
  class level2Window(Screen):
          def __init__(self, **kwargs):
              super(Level2Window, self).__init__(**kwargs)
              
  # run level2.py file here
  
  class Application(App):
      def build(self):
          sm = ScreenManagement(transition=FadeTransition())
          sm.add_widget(Level1Window(name='#'))
          sm.add_widget(Level2Window(name='#'))
          return sm
  
  
  if __name__ == &quot;__main__&quot;:
      Application().run()
  </code></pre>