Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可以在有多个文件的目录中选择确切的文件吗?基本上,我想查看目录内部,然后导入文件 (* .stl)
您可以使用glob获取与模式匹配的文件列表。
import glob stl_files = glob.glob('*.stl')
如果您可以期望一个目录中有多个 stl 文件,则可以遍历文件列表并导入每个文件,类似于此答案。