相关疑难解决方法(0)

路径名太久无法打开?

这是执行的截图:

在此输入图像描述

如您所见,错误显示目录"JSONFiles/Apartment/Rent/dubizzleabudhabiproperty"不存在.

但是看看我的文件,请:

在此输入图像描述

文件夹肯定在那里.

更新2

代码

self.file = open("JSONFiles/"+ item["category"]+"/" + item["action"]+"/"+ item['source']+"/"+fileName + '.json', 'wb') # Create a new JSON file with the name = fileName parameter
        line = json.dumps(dict(item)) # Change the item to a JSON format in one line
        self.file.write(line) # Write the item to the file
Run Code Online (Sandbox Code Playgroud)

UPDATE

当我将文件名更改为较小的文件名时,它可以正常工作,因此问题在于路径的长度.请问是什么解决方案?

python windows python-2.7

5
推荐指数
3
解决办法
6894
查看次数

标签 统计

python ×1

python-2.7 ×1

windows ×1