Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Python
<pre>import socket
import time
import keyboard
import os
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

class p:
    def p1():
        os.system("cls")
        print(">start")
def talk():
    os.system("cls")
    print("starting test")
    s.connect(("192.168.1.65",1991))

    e1=str(not gonna show the password here).encode()
    e2="test35".encode()
    e3=str(1).encode()
    s.sendall(e1)
    time.sleep(float(0.1) )
    s.sendall(e2)
    time.sleep(float(0.1) )
    s.sendall(e3)
    time.sleep(34)
    e=s.recv(999)
    print(e.decode("utf-8"))
    s.close()
    e2()
def e2():

    p.p1()
    while True:
        if keyboard.is_pressed("enter"):
            talk()
        else:
            pass
e2()


The error
<pre>Traceback (most recent call last):
  File "C:\Users\radbo\Desktop\discord bots\team_dragon_bots\test_client.py", line 37, in <module>
    e2()
  File "C:\Users\radbo\Desktop\discord bots\team_dragon_bots\test_client.py", line 34, in e2
    talk()
  File "C:\Users\radbo\Desktop\discord bots\team_dragon_bots\test_client.py", line 28, in talk
    e2()
TypeError: 'bytes' object is not callable


i sent it
test12359 done!

it would take a while for it to ether print or send it.

It may be a problem with the decoding, but the vague error message doesn't help me solve the problem.

What I have tried:

I tried changing where i put it to decode command but nothing seems to help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900