当我想输入一些字符时,我会这样做
device.press("0",MonkeyDevice.DOWN_AND_UP)
这使得输入字符'0',效果很好
但问题是我想输入 0 到 9 之间的随机数,比如说 1000 次
我怎样才能做到这一点 ?我如何在monkeyrunner中玩随机生成
我想随机选择:
device.press("0",MonkeyDevice.DOWN_AND_UP)
device.press("1",MonkeyDevice.DOWN_AND_UP)
device.press("2",MonkeyDevice.DOWN_AND_UP)
device.press("3",MonkeyDevice.DOWN_AND_UP)
...
device.press("9",MonkeyDevice.DOWN_AND_UP)
编辑
我想做这个
device.press("Random Number between zero and nine",MonkeyDevice.DOWN_AND_UP)
device.press("Random Number between zero and nine",MonkeyDevice.DOWN_AND_UP)
device.press("Random Number between zero and nine",MonkeyDevice.DOWN_AND_UP)
device.press("Random Number between zero and nine",MonkeyDevice.DOWN_AND_UP)
...
但我需要有效的语法来做到这一点