【发布时间】:2020-03-05 17:25:11
【问题描述】:
我目前正面临 window.js_obj 的问题 我有一个通过 API 和 jQuery 获得的 JSObject,但是当我尝试将获得的 JSObject 转换为适当的 Python Dict 时,似乎没有名为 js_obj 的模块进入窗口。 这是我为转换事物而写的:
userInfo_request = window.js_obj.to_dict(userInfo_request)
(userInfo_request 是我输入时包含 JSObject 的变量
print(type(userInfo_request))
<class 'JSObject'>
我在浏览器控制台中遇到的错误是:
Traceback (most recent call last):
module __main__ line 31
userInfo_request = window.js_obj.to_dict(userInfo_request)
AttributeError: no attribute js_obj for [object Window]
如果有人可以帮助我,那就太酷了 提前致谢
我正在使用 Python 3 和 Brython 3.8.7(最新版本)
【问题讨论】:
标签: javascript python json jsobject brython