调取时间

  1. import time
  2. now = time.strftime("%Y%m%d%H%M%S") # Y--year m-month d-day H-hour M-minute S-second

MD5加密

  1. import hashlib
  2. md = hashlib.md5()
  3. md.update(signtemp.encode('utf-8')) # 编码为utf-8
  4. sign1 = md.hexdigest() # 转换为16进制
  5. sign = sign1.upper() # 转换为大写

requests.post 返回值

r = requests.post(post_url, data=json.dumps(request_param), headers=headers)
print('r=', r.text)
使用r.text选取正文内容