Client.py 文件源码

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

项目:Sample-Code 作者: meigrafd 项目源码 文件源码
def update_2(self):
        if self.running == False:
            return
        # Read the length of the image as a 32-bit unsigned int.
        data_len = struct.unpack('<L', self.connection.read(struct.calcsize('<L')))[0]
        if data_len:
            printD('Updating...')
            printD('data_len: %s' % data_len)
            data = self.connection.read(data_len)
            deserialized_data = msgpack.unpackb(data, object_hook=msgpack_numpy.decode)
            printD('Frame received')
            #print(deserialized_data)
            #stdout.flush()
            img = Image.fromarray(deserialized_data)
            newImage = ImageTk.PhotoImage(img)
            self.gui.stream_label.configure(image=newImage)
            self.gui.stream_label.image = newImage
        self.gui.master.after(70, self.update_2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号