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
Although I am using a reference of a VB6 website, the value of wildcard should be
wildcard = "pictures (*.jpeg,*.png)|*.jpeg;*.png"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With