Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use multiple wildcards in Python File Dialog

how can I use the code below to have the user browse for either png or jpeg files? Did I do it correctly?

wildcard = "pictures (*.jpeg/*.png)|*.jpeg/*.png"
dlg = wx.FileDialog(self, message="Select your picture file",defaultDir=os.getcwd(),defaultFile="*.jpeg/*.png", wildcard=wildcard, style=wx.OPEN)

if dlg.ShowModal() == wx.ID_OK:
         picfile = dlg.GetFilename()
         print picfile
like image 424
user715578 Avatar asked Jan 12 '12 09:01

user715578


1 Answers

Although I am using a reference of a VB6 website, the value of wildcard should be

wildcard = "pictures (*.jpeg,*.png)|*.jpeg;*.png"
like image 178
shahkalpesh Avatar answered Oct 25 '22 16:10

shahkalpesh