V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  jerryliang  ›  全部回复第 1 页 / 共 1 页
回复总数  1
2020-05-14 11:50:31 +08:00
回复了 jerryliang 创建的主题 Python 求助腾讯云 API 编写
@ClericPy 嗯,自己 print 了 params 。是一个 str 的类型,故使用字符串拼接的方式把它拼接了,然后就搞定了
with open("1.jpg","rb") as f:
base64_data = base64.b64encode(f.read())
#print(base64_data)
#print(type(base64_data))
req = models.GeneralBasicOCRRequest()
a = "{\"ImageBase64\":\""
b = "\"}"
params = a + base64_data + b
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5716 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 02:30 · PVG 10:30 · LAX 19:30 · JFK 22:30
Developed with CodeLauncher
♥ Do have faith in what you're doing.