python3 subprocess.getstatusoutput() 获取命令返回结果

comm = f"curl -Ivs https://{host}.{name}:{port} --connect-timeout 5"

result = subprocess.getstatusoutput(comm)
f.write(result[1])
status_code = result[0]

m = re.search(r'Trying (.*?)...\n.*?subject:.*? CN=(.*?)\n.*?start date: (.*?)\n.*?expire date: (.*?)\n',
              f.getvalue(), re.M | re.S)

你可能感兴趣的:(python)