wxTerminal.py 文件源码

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

项目:btc-fpga-miner 作者: marsohod4you 项目源码 文件源码
def OnSaveAs(self, event):
        """Save contents of output window."""
        filename = None
        dlg = wx.FileDialog(None, "Save Text As...", ".", "", "Text File|*.txt|All Files|*",  wx.SAVE)
        if dlg.ShowModal() ==  wx.ID_OK:
            filename = dlg.GetPath()
        dlg.Destroy()

        if filename is not None:
            f = file(filename, 'w')
            text = self.text_ctrl_output.GetValue()
            if type(text) == unicode:
                text = text.encode("latin1")    #hm, is that a good asumption?
            f.write(text)
            f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号