postprocess.pyシェル スクリプト を介して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ファイルはディレクトリに存在します。