Python 3 WxPython File Picker Dialog Matching Different Extensions Wildcards GUI Desktop App

Python 3 WxPython File Picker Dialog Matching Different Extensions Wildcards GUI Desktop App

Python 3 WxPython File Picker Dialog Matching Different Extensions Wildcards GUI Desktop App

import wx
import os

if __name__ == "__main__":
    app = wx.PySimpleApp()
    wildcard = "Python source (*.py)|*.py|" 
            "Compiled Python (*.pyc)|*.pyc|" 
            "All files (*.*)|*.*"
    dialog = wx.FileDialog(None, "Choose a file", os.getcwd(), 
            "", wildcard, wx.FD_OPEN)
    if dialog.ShowModal() == wx.ID_OK:
        print(dialog.GetPath()) 

    dialog.Destroy()
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment