executor関数を定義することによって、クライアントノードのクラスNetworkUtilityで継承された関数を定義しました。 あなたは教えてください、なぜそれはエラーの上に表示されます。私はそれについての手がかりがありません。TypeError:executor()は引数をとりません(1が指定されています)
#!/usr/bin/python
import socket
from NetworkUtility import NetworkUtility
#import json
HOST = '' # get local machine name by socket.gethostname()
PORT = 50007 # The same port as used by the server,reserve a port for ur service reserve port
class ClientNode(object): #if you don't want to inherit NetworkUtility
def executor():
cn1 = NetworkUtility()
cn1.setupClientConnection(HOST, PORT)
cn1.sendMessage('Client 1: Hello')
print cn1.receiveMessage()
cn1.endConnection()
c = ClientNode()
c.executor()
クラス内にある場合は、クラスインスタンスに「self」を渡している可能性があります。 –