my code is as follows:
import openpyxl
from openpyxl import load_workbook
def process(input="Input-Migration Table.xlsx", output_dir="\output"):
dic_atn = {}
for row in sheet2.iter_rows(min_col=3,min_row=2,max_col=3,max_row=17):
for cel in row:
dic_atn[cel.value] = ""
for key in dic_atn:
for i in range(3,6):
if(sheet1.cell(row=i,column=1).value == key):
loopback = sheet1.cell(row=i,column=2).value
break
for col_config in range(2,11):
if(sheet3.cell(row=1,column=col_config).value == sheet2.cell(row=row,column=24).value + "-" + sheet2.cell(row=row,column=23).value):
for i in range(3,78):
if "<Loopback0>" in sheet3.cell(row=i,column=col_config).value:
new_loopback = sheet3.cell(row=i, column=col_config).value.replace("<Loopback0>",loopback)
process()
i search from google, it said this error is caused by using a variable out of function, but here, variable "loopback" is defined and used all in function process, why i still get this error ?