命令(就是用 Python 调用 API ):
root@wbzd:~/SDK# ./api.sh
输出:
...
Using /usr/local/lib/python3.8/dist-packages
Searching for pycparser==2.21
Best match: pycparser 2.21
Adding pycparser 2.21 to easy-install.pth file
Using /usr/local/lib/python3.8/dist-packages
Finished processing dependencies for alibabacloud-sample==1.0.0
[LOG] {"headers": {"date": "Tue, 17 Jan 2023 04:19:12 GMT", "content-type": "application/json;charset=utf-8", "content-length": "213", "connection": "keep-alive", "access-control-allow-origin": "*", "x-acs-request-id": "77CA0B1F-7781-5679-9984-DC9FECB939C3", "x-acs-trace-id": "d3cb936cc33927344d8bc35a63488b2f"}, "statusCode": 200, "body": {"Data": {"Elements": [{"Boxes": [6, 104, 599, 799], "Score": 0.587, "Type": "human"}, {"Boxes": [238, 456, 456, 574], "Score": 0.206, "Type": "glasses"}], "Height": 800, "Width": 600}, "RequestId": "77CA0B1F-7781-5679-9984-DC9FECB939C3"}}
目的:
把[LOG]后所有内容保存到 JSON 文件中。
1
tomczhen 2023-01-17 12:40:48 +08:00 via Android
建议用 chatgpt 。
|
2
lhbc 2023-01-17 12:45:32 +08:00 via Android
with open('filename.json') as f
OP 没有写过代码的话,建议找运维来写吧 |
3
ChengLuffy 2023-01-17 12:48:55 +08:00 1
|
4
wbzd OP @ChengLuffy 太好了!一遍通过,谢谢您。
|