def OnSaveAs(self, event):  # wxGlade: TerminalFrame.<event_handler>
        with wx.FileDialog(
                None,
                "Save Text As...",
                ".",
                "",
                "Text File|*.txt|All Files|*",
                wx.SAVE) as dlg:
            if dlg.ShowModal() == wx.ID_OK:
                filename = dlg.GetPath()
                with codecs.open(filename, 'w', encoding='utf-8') as f:
                    text = self.text_ctrl_output.GetValue().encode("utf-8")
                    f.write(text)
Save contents of output window.
dataset/ETHPy150Open pyserial/pyserial/examples/wxTerminal.py/TerminalFrame.OnSaveAs