sniff_ui_threading.py 文件源码

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

项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码
def _print_packet_contents(self, event, listbox):
        packet = self.l_packets[listbox.curselection()[0]]
        hex_contents = MyUI._hexdump(packet)

        ## ?????? Start
        # state="normal",??????????, ?????? state ? disabled ???????
        self.hex_text.configure(state="normal")
        self.hex_text.delete("1.0", tkinter.END)  # ???????
        self.hex_text.insert(tkinter.END, hex_contents)
        self.hex_text.configure(state="disabled")
        ## ?????? End

        ## ??????? Start
        # ? show ?? print ??????, ??? stdout ????
        with io.StringIO() as buf, redirect_stdout(buf):
            packet.show()
            show_str = buf.getvalue()

        self.contents_text.configure(state="normal")
        self.contents_text.delete("1.0", tkinter.END)  # ???????
        self.contents_text.insert(tkinter.END, show_str)
        self.contents_text.configure(state="disabled")
        ## ??????? End
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号