|
楼主 |
发表于 2020-9-23 12:29:43
|
显示全部楼层
本帖最后由 S.wession 于 2020-9-23 12:37 编辑
import os
add_ip=('ping 106.38.56.52 -t',
'ping 11.20.132.17 -t',
"ping 192.168.0.4 -t",
"ping 192.168.0.3 -t"
"ping 11.204.32.16 -t"
"ping 192.168.0.30 -t"
"ping 13.17.44.5 -t"
"ping 13.17.44.2 -t"
"ping 13.17.44.8 -t"
)
number='123456789' #指定一个范围
count=1
while count>0:
try:
temp=input("请输入对应的序号:\
\n1、涿州服务器\
\n2、房山正式服务器\
\n3、0.4内网\
\n4、0.3内网\
\n5、房山测试服务器\
\n6、0.30内网\
\n7、0.30外网\
\n8、0.3外网\
\n9、0.4外网\
\n此处输入序号:")
if temp in number:
os.system(add_ip[int(temp)])
count=count-1
else:
print("非指定序号,重新输入!!!\n\n")
continue
except:
print("参数类型错误,重新输入!!!\n\n") |
|