python 怎么传list给js端
相关代码
# python接收js来的消息
def OnReceiveMessageFromJS(self, strParameter):
print(strParameter)
# 这里是从csv里面拉取得数据
list = self.vm.loadCsv("./doc/2.csv")
# list格式如下 [{"name":"aa","age":2},{"name":"bb","age":3}]
print(list);
# 这里我要把 list传给js 但是这么写程序就死掉了
self.OnSendMessageByInteractObj(list)
# python发消息给js
def OnSendMessageByInteractObj(self,strMessage):
self.SigSendMessageToJS.emit(strMessage)
我也有同个问题。