Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么通过Matlab在调用Python websocket函数时添加关键字参数会引发错误?_Python_Matlab_Websocket - Fatal编程技术网

为什么通过Matlab在调用Python websocket函数时添加关键字参数会引发错误?

为什么通过Matlab在调用Python websocket函数时添加关键字参数会引发错误?,python,matlab,websocket,Python,Matlab,Websocket,我需要将以下代码从Python翻译成Matlab语法 工作正常的Python代码: ws = websocket.create_connection("wss://echo.websocket.org", sslopt={"cert_reqs": ssl.CERT_NONE}) Matlab翻译尝试: ws = py.websocket.create_connection('wss://echo.websocket.org/', pyargs('sslopt','{"cert_reqs": s

我需要将以下代码从Python翻译成Matlab语法

工作正常的Python代码:

ws = websocket.create_connection("wss://echo.websocket.org", sslopt={"cert_reqs": ssl.CERT_NONE})
Matlab翻译尝试:

ws = py.websocket.create_connection('wss://echo.websocket.org/', pyargs('sslopt','{"cert_reqs": ssl.CERT_NONE}'))
此Matlab行给出以下错误:

使用ssl套接字(第245行)时出错Python错误:ValueError: 字典更新序列元素#0的长度为1;2是必需的

http>connect中出错(第126行) sock=\u ssl\u套接字(sock,options.sslopt,主机名)

核心>连接中出错(第223行) options.pop('socket',None))

_core>创建_连接时出错(第514行) 连接(url,**选项)

有趣的是,不添加关键字参数是可行的,但是它对我没有帮助,因为我必须跳过SSL证书验证:

ws = py.websocket.create_connection('wss://echo.websocket.org/')
我曾尝试在以前的相关线程中添加url=或name=等,但均无效:

ws = py.websocket.create_connection(py.list({'url','wss://echo.websocket.org/'}),pyargs('sslopt','{"cert_reqs": ssl.CERT_NONE}'))
我想这是一个语法问题!一个好主意会很有帮助,谢谢