小编Cai*_*dre的帖子

Python 错误:“属性错误:__enter__”

所以,我无法加载我的 json 文件,我不知道为什么,谁能解释我做错了什么?

async def give(msg, arg):
    if arg[0] == prefix + "dailycase":
                with open("commands/databases/cases.json", "r") as d:
                     data = json.load(d)
Run Code Online (Sandbox Code Playgroud)

由于某种原因,我收到此错误:

    with open("commands/databases/cases.json", "r") as d:
AttributeError: __enter__
Run Code Online (Sandbox Code Playgroud)

python json enter

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

enter ×1

json ×1

python ×1