1

i use openfile in my code i need to open nectcdf4 file and txt file how can i add it in my code :

 def onOpen(self, event):
        wildcard = "netCDF4 files (*.nc)|*.nc" #here need add .TXT 
        dialog = wx.FileDialog(self, "Open netCDF4", wildcard=wildcard,
                               style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)

        if dialog.ShowModal() == wx.ID_CANCEL:
            return


        path = dialog.GetPath()

i use wxpython for python3.6

thanks for help

Sarah Tohami
  • 59
  • 1
  • 12

1 Answers1

2

You can either add a semi-colon followed by another wildcard string, such as

"Audio|*.mp3;*.wav;*.flac;*.ogg;*.dss;*.aac;*.wma;*.au;*.ra;*.dts;*.aif"

which is useful for creating groups of related files

or

add another pipe character | and a new wildcard description and definition, such as:

wildcard ="netCDF4 files (nc)|*.nc| Text files (txt) |*.txt| All files |*.*"
Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60
  • if you can help please https://stackoverflow.com/questions/55258420/selection-file-in-a-panel-and-visualize-in-another-panel-wxpython thank u – Sarah Tohami Mar 20 '19 at 21:22