Search code examples
pythonpython-2.7wxpythonwildcard

How do I have multiple wildcards?


I am using wxpython and Python v2.7 to make a text editor. Here is my save dialog:

dlg = wx.FileDialog(self, 'Save File', self.dirname, 'Untitled', 'All files (*.*)|*.*', wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)

For the wildcard parameter I have 'All files (*.*)|*.*'
I need to also have 'Text Document (*.txt)|*.txt'
How can I have multiple wildcards here, without creating a variable to store them?

Thanks,
xPotatoes


Solution

  • Apparently you can just do:

    dlg = wx.FileDialog(self, 'Save File', self.dirname, 'Untitled', 'All files (*.*)|*.*|Text Document (*.txt)|*.txt', wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
    

    Just use | as a separator and add append pairs of descriptions and wildcard expressions.