pySIMsms.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SIMreader 作者: stoic1979 项目源码 文件源码
def doExport(self, event):
        dlg = wx.FileDialog(self, "Save to file:", ".", "", "Text (*.txt)|*.txt", wx.SAVE|wx.OVERWRITE_PROMPT)
        if dlg.ShowModal() == wx.ID_OK:
            i = dlg.GetFilterIndex()
            if i == 0: # Text format
                try:
                    f = open(dlg.GetPath(), "w")
                    f.write("# Date, From, SerivceCenter, Message\n")
                    for i in self.itemDataMap.keys():
                        entry = self.itemDataMap[i]
                        f.write('%s,%s,%s,%s\n' % (entry[1], entry[2], entry[4].smsc, entry[3]))
                    f.close()
                    pySIMmessage(self, "SMS export to file was successful\n\nFilename: %s" % dlg.GetPath(), "Export OK")
                except:
                    pySIMmessage(self, "Unable to save your SMS messages to file: %s" % dlg.GetPath(), "Export error")
                    #print_exc()

        dlg.Destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号