# -*- coding: utf-8 -*- from aip import AipOcr """ 你的 APPID AK SK """ APP_ID = 'xxx' API_KEY = 'xxx' SECRET_KEY = 'xxx' client = AipOcr(APP_ID, API_KEY, SECRET_KEY) def get_file_content(filePath): with open(filePath, 'rb') as fp: return fp.read() img_loc ='./1611310671779.jpg' image = get_file_content(img_loc) message = client.businessLicense(image) words_result = message['words_result'] for i in words_result: print(i + ':' +str(words_result[i]['words']))