相关疑难解决方法(0)

使用命名临时文件

with NamedTemporaryFile(suffix='.shp').name as tmp_shp:
    df.to_file(tmp_shp)
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我收到此错误:

with NamedTemporaryFile(suffix='.shp').name as tmp_shp:
    df.to_file(tmp_shp)
Run Code Online (Sandbox Code Playgroud)

如何使用 with 语句使用命名临时文件?既然tmp_shp只是一条路径,它在 之外仍然可用吗with

python temporary-files

3
推荐指数
1
解决办法
6203
查看次数

标签 统计

python ×1

temporary-files ×1