在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
答案 0 :(得分:2)
将*.*
更改为*
所以现在整个文件名都在外卡下,并且不需要点