# 输入模块
def input_interest():
# 初始化数组
i = 1
abnormal = 0
name1 = []
name2 = []
client = []
Fscreen = []
logo = []
qualification = []
intercommunication = []
loading = []
gear = []
payment = []
time1 = []
while i==1:
#输入游戏的名称
abnormal = input("请输入游戏全名:")
name1.append(abnormal)
abnormal = input("请输入游戏显示名称:")
name2.append(abnormal)
# 输入测试包体的客户端
while i==1:
abnormal = input("请输入客户端类别:")
if abnormal == "ios" or abnormal == "安卓" or abnormal == "H5" or abnormal == "iOs":
client.append(abnormal)
break
else:
print("请输入正确参数!")
# 判断闪屏有无问题
while i==1:
abnormal = input("闪屏有无问题?")
if abnormal=="有"or abnormal=="无" :
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
Fscreen.append("异常("+abnormal+")")
else:
Fscreen.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断logo有无问题
while i == 1:
abnormal = input("logo有无问题?")
if abnormal == "有" or abnormal == "无":
if abnormal== "有":
abnormal = input("异常现象表现有什么?")
logo.append("异常(" + abnormal + ")")
else:
logo.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断资质有无问题
while i == 1:
abnormal = input("资质有无问题?")
if abnormal == "有" or abnormal == "无":
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
qualification.append("异常(" + abnormal + ")")
else:
qualification.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断登录初始化有无问题
while i == 1:
abnormal = input("登录初始化有无问题?")
if abnormal== "有" or abnormal == "无":
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
loading.append("异常(" + abnormal + ")")
else:
loading.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断双端互通有无问题
while i == 1:
abnormal = input("双端互通有无问题?")
if abnormal == "有" or abnormal == "无":
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
intercommunication.append("异常(" + abnormal + ")")
else:
intercommunication.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断充值档位有无问题
while i == 1:
abnormal = input("充值档位有无问题?")
if abnormal == "有" or abnormal == "无":
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
gear.append("异常(" + abnormal + ")")
else:
gear.append(abnormal)
break
else:
print("请输入有或者无!")
# 判断支付有无问题
while i == 1:
abnormal = input("支付有无问题?")
if abnormal == "有" or abnormal == "无":
if abnormal == "有":
abnormal = input("异常现象表现有什么?")
payment.append("异常(" + abnormal + ")")
else:
payment.append(abnormal)
break
else:
print("请输入有或者无!")
# # 记录登记时间
import time
t=time.localtime()
abnormal=time.strftime(" %Y-%m-%d %H:%M:%S", t)
time1.append(abnormal)
result=[]
Break=input("如要结束请输入是")
if Break == "是":
break
length=len(time1)
# print(len(name1),len(name2),len(client),len(Fscreen),len(logo),len(qualification),len(loading),len(intercommunication),len(gear),len(payment),len(time1),)
for b in range(length):
x=[name1[b], name2[b], client[b], Fscreen[b], logo[b], qualification[b], loading[b], intercommunication[b],gear[b], payment[b], time1[b]]
result.append(x)
# result.append([name1[b], name2[b], client[b], Fscreen[b], logo[b], qualification[b], loading[b], intercommunication[b],gear[b], payment[b], time1[b]])#这里报错
return result
#建表模块
def save_to_excel(result):
import openpyxl
wb = openpyxl.Workbook()
ws = wb.active
ws['A1'] = "游戏名称"
ws['B1'] = "icon名称"
ws['C1'] = "客户端"
ws['D1'] = "闪屏"
ws['E1'] = "logo"
ws['F1'] = "资质"
ws['G1'] = "登录初始化"
ws['H1'] = "双端互通"
ws['I1'] = "充值档位"
ws['J1'] = "支付"
ws['K1'] = "时间"
for each in result:
ws.append(each)
wb.save("测试记录.xlsx")
def main():
# result=["1","2","3","4"]
result=[]
result.extend(input_interest())
print(result)
# with open("test.txt", "w", encoding="utf-8") as f:
# for each in result:
# f.write(each)
save_to_excel(result)
if __name__ == "__main__":
main()
修好了开心
|