0

使用 sampleTextEditor 中的这个示例,在浏览时我可以看到并且可以打开任何带有扩展名的文件 ( . )。如何打开没有扩展名的文件?

def defaultFileDialogOptions(self):
    ''' Return a dictionary with file dialog options that can be
        used in both the save file dialog as well as in the open
        file dialog. '''
    return dict(message='Choose a file', defaultDir=self.dirname,
                wildcard='*.*')

def askUserForFilename(self, **dialogOptions):
        dialog = wx.FileDialog(self, **dialogOptions)
        if dialog.ShowModal() == wx.ID_OK:
            userProvidedFilename = True
            self.filename = dialog.GetFilename()
            self.dirname = dialog.GetDirectory()
            self.SetTitle() # Update the window title with the new filename
        else:
            userProvidedFilename = False
        dialog.Destroy()
        return userProvidedFilename
4

1 回答 1

2

更改*.**

所以现在整个文件名都在通配符下,不需要点

于 2012-08-06T12:36:37.310 回答