【发布时间】:2017-11-12 11:52:51
【问题描述】:
我有以下代码:
import os
import trimesh
# Core settings
rootdir = 'path'
extension = ".zip"
for root, dirs, files in os.walk(rootdir):
if not root.endswith(".zip"):
for file in files:
if file.endswith(".stl"):
mesh = trimesh.load(file)
我收到以下错误:
ValueError: File object passed as string that is not a file!
但是,当我一个一个打开文件时,它可以工作。可能是什么原因?
【问题讨论】:
标签: python subdirectory trimesh