when run my script shows this error :”Error reading replacement lists from Excel: Missing parentheses in call to ‘print’. Did you mean print(…)? (init.py, line 1187)
Failed to read replacement lists from Excel.”, but before this script run normally, suddenly show this error. what kind of reason caused this error? the error shows error comes from “init.py, line 1187″, where should find this “init.py, line 1187″ in my project?
error when run this code:
def read_replacement_lists_from_excel(file_path):
try:
df = pd.read_excel(file_path, sheet_name=”Sheet2″, dtype=str) # 强制转换为字符串
replacement_keys = df[“A”].tolist()
replacement_values = df[“B”].tolist()
print(f”Replacement keys: {replacement_keys}”)
print(f”Replacement values: {replacement_values}”)
return replacement_keys, replacement_values
except Exception as e:
print(f”Error reading replacement lists from Excel: {e}”)
return None, None
try to search the “init.py” in my project directory, find one but only a few rows, without 1187 rows.
chunming huang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.