我正在尝试postprocess.py通过 shell 脚本运行 Python 脚本Allrun.sh。
当我手动执行 Python 脚本时它工作正常,但是当我运行Allrun.sh.
#!/bin/bash
# File: Allrun.sh
python postprocess.py
postprocess.py这是引发错误的一小部分
for files in os.listdir("."):
if files.endswith(".stl"):
STLfile = files
f = open(STLfile,'r')
错误:
第 797 行,在 PostProcessing f = open(STLfile,'r') NameError: name 'STLfile' is not defined
但是,.stl目录中确实存在一个文件。