0

I am attempting my first Android app, using Python3, kivy and Buildozer. All sees to go well, the program runs n Python and the Androd app launches. However, when the method below is called (by the click of a button) on the Android the app closes. Probably something completely obvious, but my novice eyes can't see it. I'd be grateful if someone can point me in the right way. (Sorry to post so much script - but I can't figure what is causing the problem).

def popup (self, *args):
  self.findings = []
  with open("./patterns/list.txt", "r") as f :
    for l in iter(f) :
      if len(self.t.text) > 0 :
        if self.t.text in l :
          l = l.rstrip('\n')
          t = tuple(l.split(','))
          self.findings.append( t )

  self.pop = Popup(title='Search Results = ' + str(len(self.findings)))
  b2 = BoxLayout(orientation='vertical')
  car = Carousel(direction='right', loop=True)
  but3 = Button(text='Close', font_size=50, size_hint_y=None, height=80)
  b2.add_widget(car)
  b2.add_widget(but3)
  self.pop.add_widget(b2)
  but3.bind(on_release=self.close)

  for i in self.findings :
    image = Image(source="./patterns/"+i[0]+".png")
    car.add_widget(image)

  self.pop.open()
4

0 に答える 0