python list index of range_我在Python中得到一个错误“list index out of range”

我用Squish编写了一个Python代码。

下面是一段代码,上面写着错误是:这是什么意思?在

数组=[[“1,6”,“3,0”,“7,0”,'null',True,]]

(columnEnd-columnStart)=10

for循环的开始for r in range(len(array)):

waitForObjectItem(object_id, str(r + rowStart) + "/" + str(columnStart))

clickItem(waitForObject(object_id), str(r + rowStart) + "/" + str(columnStart), 0, 0, 0, Qt.LeftButton);

for c in range(columnEnd - columnStart)

# Getting an error at this point , if loop

if array[r][c] != 'null':

print "array index is : {}".format(array[r][c])

print "row is {}".format(r)

print "column is {}".format(c)

dataType = array[r][c].__class__

print "dataType is {}".format(dataType)

checkState = item_checks(object_id, r + rowStart, c + columnStart).checkState;

print "checkstate is {}".format(checkState)

if (dataType == str and (checkState == "uncheckable" or checkState == "unknown")):

waitForObjectItem(object_id, str(r + rowStart) + "/" + str(c + columnStart))

doubleClickItem(waitForObject(object_id), str(r + rowStart) + "/" + str(c + columnStart), 1, 1, 0, Qt.LeftButton)

widget = "{type='QWidget' unnamed='1' container='" + object_id + "'}";

txt = array[r][c]

txtString = str(txt)

type(waitForObject(widget), "")

type(waitForObject(widget), str(array[r][c]))

try:

type(waitForObject(widget), str(""))

except Exception(err):

raise Exception ("Error is found :- {}".format(err))

elif ((array[r][c] == True or array[r][c] == False) and (checkState != "uncheckable" and checkState != "unknown")):

print "data type boolean loop"

waitForObjectItem(object_id, str(r + rowStart) + "/" + str(c + columnStart))

if (array[r][c] != (item_checks(object_id, r + rowStart, c + columnStart).checkState == "checked")):

rowHeight = waitForObject(object_id).rowHeight(r + rowStart)

clickItem(waitForObject(object_id), str(r + rowStart) + "/" + str(c + columnStart), 10, rowHeight / 2, 0, Qt.LeftButton)

else:

raise Exception(object_id + ": dataType '" + str(dataType) + "' doesen't match to expected one of cell or is unknown or unhandled")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值