import boto3
import json
import datetime
def _format(o):
if isinstance(o, datetime.datetime):
return o.__str__()
client = boto3.client('ec2')
x = client.describe_instances()
print(json.dumps(x, default=_format))
import boto3
import json
import datetime
def _format(o):
if isinstance(o, datetime.datetime):
return o.__str__()
client = boto3.client('ec2')
x = client.describe_instances()
print(json.dumps(x, default=_format))
本文标题:boto3输出json格式
本文链接:https://www.haomeiwen.com/subject/lskggftx.html
网友评论