相关疑难解决方法(0)

Python:为什么我收到AttributeError:__enter__

我没有重新分配open关键字,但仍然收到此错误。有任何建议或指导来纠正我的错误吗?

 with tempfile.mkdtemp() as test_dir:
        print(test_dir)
Run Code Online (Sandbox Code Playgroud)

AttributeError: __enter__

我也是python的新手,我很难理解这些概念。

python temporary-directory attributeerror contextmanager

2
推荐指数
1
解决办法
1250
查看次数