import requests
import json
import pymysql
code = input("请输入id:")
#print(code)
code1 = (repr(code))
#print(code1)
#通过调接口生成加密后code
url = "http://XXX/generateId"
params = {
"List": code
}
headers = {'content-type': "application/json", "Label": "S"}
r = requests.post(url, data=json.dumps(params), headers=headers)
#print(r.text)
#获取上个步骤的加密code
connection = pymysql.connect(host="base", user="A", password="V", db="C", port=3306, charset='utf8')
cur = connection.cursor()
sql = "select crypt from C t where t.code = %s" %(code1)
#print(sql)
try:
cur.execute(sql)
result = cur.fetchall()
except:
print('Error:unable to fetch data')
#print(result)
cryptcode = result[0]
#print(cryptcode)
results = "https://XXX&Id=%s"%(code)+"&Idcrypt=%s"%(cryptcode)
print("ID二维码生成链接:%s \n"%(results))
connection.close()
input('press enter to exit!')
python脚本 ——二维码链接获取
wshlp1234562024-02-04 14:12
相关推荐
Code Warrior3 分钟前
【C++】智能指针的使用及其原理05大叔4 分钟前
多线程的学习白露与泡影8 分钟前
使用systemd,把服务装进 Linux 心脏里~lly20240612 分钟前
C 位域:深度解析其概念、应用与未来趋势刺客xs13 分钟前
多路IO复用yaoh.wang30 分钟前
力扣(LeetCode) 100: 相同的树 - 解法思路Sunsets_Red1 小时前
2025 FZYZ夏令营游记guslegend1 小时前
第2章:LangChain大模型工具开发(Agent工具能力)草帽lufei1 小时前
Ubuntu中为AI Agent相关开发配置Python环境Daily Mirror1 小时前
Day41 Grad-CAM 与 Hook 函数