Hi,
this function prints output of socket recv(). In my code, socket connects to the Samsung TV.
def connection_status(self):
connection_status = sock.recv(64)
label_connection_status = "Status: ", connection_status
label_connection_status = Label(self.master, text= label_connection_status)
label_connection_status.grid(row=7, column=3, columnspan=4, padx=(15,0), ipady=8, sticky=W)
The label gives me this:
With print("Status: ", connection_status) i getting this: ('Status: ', '\x00\x0c\x00iapp.samsung\x04\x00d\x00\x01\x00')
And with print(label_connection_status) i getting this: .139719774023552
My questions are:
How to format the ouput and why is output of
print(label_connection_status).139719774023552??I want to write "Status: Connected" in label if recv() returns something and "Status: Disconnected" if recv() returns "" (dont return anythink)
I want to update the connection state with recv() every 1 second
Please help me! And sorry for my bad english. Thank you.