您能帮我弄清楚如何解决此问题或如何声明变量吗?这只是我的代码的一部分,而是发生错误的部分。
def send_message(self, message, source = "Python Client", type = serialize.Message.INFO_MESSAGE):
md = Command.RTDE_TEXT_MESSAGE
fmt = '>B%dsB%dsB' % (len(message), len(source))
payload = struct.pack(fmt, len(message), message, len(source), source, type)
return self.__sendall(cmd, payload)
这是我遇到的错误
File "..\rtde\rtde.py", line 187, in RTDE
def send_message(self, message, source = "Python Client", type = serialize.Message.INFO_MESSAGE):
NameError: name 'serialize' is not defined