使用参数作为变量时出错

2024-09-28 22:28:50 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试使用int变量"row"作为Excelread行中的参数,以便进行迭代。我得到错误,因为python没有识别为int输入?你知道吗

from automagica import *
Row = 2

current_run = ExcelReadCell(path="C:\\Users\\jmoloney\\Downloads\\Medicaid.xlsx", r=Row, c=1, sheet=None)
Row = Row+1
print(current_run)

输出:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ExcelReadCell() got an unexpected keyword argument 'r'

Tags: pathrunfromimport参数错误currentusers