A
A
Amintas2021-11-09 11:11:26
Python
Amintas, 2021-11-09 11:11:26

How to convert string to socket?

There is a code:

client_socket, addr = server.accept()
sock = str(client_socket)

print(client_socket == sock )
#False

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zanak, 2022-01-08
@Zanak

client_socket is an object.
sock is the string received for this object.
how to make an object, obviously not a string, match its string representation? obviously, no way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question