【发布时间】:2021-02-19 08:40:07
【问题描述】:
请告诉我这段代码有什么问题?
代码:
import tempfile
import os
temp_dir=tempfile.TemporaryDirectory()
print("Directory name:", temp_dir)
os.removedirs(temp_dir)
错误:
Exception has occurred: TypeError
rmdir: path should be string, bytes or os.PathLike, not TemporaryDirectory
【问题讨论】:
标签: python python-3.x python-3.9