【python】http和终端请求

  • http 请求:

response = requests.get(url)
dat = json.loads(response.text)

  • 终端请求

output = subprocess.run(url, stdout=subprocess.PIPE, shell=True)
strJson = output.stdout.decode()
strJsonloads = json.loads(strJson)

你可能感兴趣的:(【python】http和终端请求)