你把 io.appium.uiautomator2.server, io.appium.uiautomator2.server.test 这两个 apk 重新安装一下试试
自己写了一个简单的 HTML
for rownum in range(1, nrows):
row = table.row_values(rownum)
print row
if row:
app = {}
for i in range(len(colnames)):
app[colnames[i]] = row[i]
print app
# 这里从for移出来,不然重复添加了
list.append(app)
这么写的不费劲吗?直接用 zip() 就可以生成带 Excel title 的字典。
for rownum in range(1, nrows):
row = table.row_values(rownum)
print row
if row:
app = dict(zip(colnames, row))
# 这里从for移出来,不然重复添加了
list.append(app)
我遇到过同样的面试题
import re
def string2int01(string):
result = 0
sign = 0
temp = 0
if string[0] == '-':
sign = 1
for str in string[::-1]:
if str in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
result += int(str) * (10 ** temp)
temp += 1
if sign == 1:
result = 0 - result
return result
def string2int02(string):
result = 0
aim = re.findall('[0-9]+', string)
size = len(aim) - 1
for i in range(size, -1, -1):
result += int(aim[i]) * (10 ** (size - i))
if string[0] == '-':
result = 0 - result
return result