0
Here is an excerpt from the code:
def CriarServer(self):
Host = self.Txt1.get()
Port = self.Txt2.get()
sockobj = socket(AF_INET, SOCK_STREAM) #Erro
sockobj.bind((Host, Port))
sockobj.listen(5)
while True:
data = conexão.recv(1024)
if not data: break
conexão.close()
As I am in a program in Tkinter, I asked Python to take the text of two inputs, one port and one host, but when you take the text of a Form, it comes as a string and socket bind only accepts integer numbers to do the assignment. As I convert the string to int
?
Error:
sockobj.bind(int(Host, Port))Typeerror: 'str' Object cannot be Interpreted as an integer.
There were several people giving negative for no reason.
– user63295
Thank you very much, when you give the time I accept the answer.
– user63295