def popping(self, button_instance):
self.small_page = Popup(title='Choose jpg or png file',size_hint=(.8,.8))
self.scroll = ScrollView()
self.small_page.add_widget(self.scroll)
file_choose = FileChooserListView()
self.scroll.add_widget(file_choose)
self.upload_pic = Button(text='Upload', size_hint=(1,.2), on_press= self.uploading(file_choose.selection))
self.small_page.add_widget(self.upload_pic)
self.small_page.open()
def uploading(self, filename):
profile_pic.source = filename[0]
我有一个 kivy 弹出窗口,它会转到文件选择器,每次我尝试访问文件时都会出错,如果可能的话可以用 python 语言而不是 kivy 编写答案。
IndexError: list index out of range
九州编程
相关分类