匿名
发表于 2023-3-29 15:42:33
帮我检查下代码错误:
set $folder "D:/CODEV/1"
set $excel "kk.xlsx" !导出excel文件名
!打开excel,准备写入数据
open_excel($excel)
write_excel_cell("TRAY ABBERATION", 1, 1) !写入标题
set $row = 2
!遍历文件夹内所有len文件
for $file in glob("$folder/*.len")
open_lens_file($file)
set $num_configs = get_num_configs()
!遍历每个组态的光线像差图
for $config in range($num_configs)
set $image = get_image("OPD", $config) !获取光线像差图
set $image_name = basename($file) + "_" + str($config) !构造图片名
if $row % 2 == 0:
set $col = 1
else:
set $col = 7
set $row = $row + 1
insert_image($image_name, $image, $col, $row, 6, 8) !插入图片
set $row = $row + 8 !更新行数
close_lens_file()
end for
!保存并关闭excel
save_excel($excel)
close_excel() |
|