wxpython知道文件的路径,如何确定是否是图片
wxpython知道文件的路径,怎么确定是否是图片如题。。dialog wx.lib.imagebrowser.ImageDialog(self, None)
wxpython知道文件的路径,怎么确定是否是图片
如题。。
dialog = wx.lib.imagebrowser.ImageDialog(self, None)
if(dialog.ShowModal() == wx.ID_OK):
self.directory = dialog.GetFile()
由self.directory怎么知道这个文件是不是图片。。我不想要逐个图片格式的测试。。。 wxPython Python
[解决办法]python有imghdr模块做这个事,见http://docs.python.org/2/library/imghdr.html。