我正在编写一个脚本,使用一个测试框架在这些标签上重新创建用户的操作。我正在使用以下命令:
listBox.LabelButton.Keys("[Enter]")
winword.WaitProcess("winword", 2000)
listBox.LabelButton2.Keys("[Enter]")
winword.WaitProcess("winword", 2000)
listBox.LabelButton3.Keys("[Enter]")
winword.WaitProcess("winword", 2000)
一直到listBox.LabelButton5
。我如何遍历它以最小化Python上的冗余?你知道吗
我试过了
listbox.LabelButton.Keys("[Enter]")
winword.WaitProcess("winword",2000)
for i in range (2,6):
listBox.LabelButton + str(i).Keys("[Enter]")
winword.WaitProcess("winword", 2000)
在Python中,这在语法上是不正确的。什么是合适的方法?你知道吗
列一个按钮列表或元组;遍历:
我怀疑你有一些重复的按钮创建过程;这是一个很好的时间把它们都塞进一个列表。你知道吗
相关问题 更多 >
编程相关推荐