Я боролся с тем, как загрузить несколько изображений из папки с помощью wxFileDialog, а затем добавить эти изображения в массив. Вот код:
def loadImages(self, e):
wildcard = 'JPEG files (*.jpg)|*.jpg|' +\
'PNG files (*.png)|*.png|' +\
'Other files (*.*)|*.*'
dlg = wx.FileDialog(self, "Choose images",
wildcard=wildcard, style=wx.FD_OPEN | wx.FD_MULTIPLE)
if dlg.ShowModal() == wx.ID_OK:
self.imageName = dlg.GetFilename()
self.directory = dlg.GetDirectory()
self.image = self.directory + '/' + self.imageName
for dlg in dlg.GetPaths():
image = Image.open(dlg)
self.imagesA = np.append(self.imagesA, image)
dlg.Destroy()
Любая помощь будет оценена. Спасибо!