如何追加python flas返回的2个json响应

2024-09-30 01:28:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我有2个由python flask返回的响应

response1 = jsonify(teachers=teachers)
{
      "teachers" : [
            {
                "name":"Mary"
            }
      ]
}
response2 = jsonify(students=students)
    {
      "students" : [
            {
                "name":"John"
            }
      ]
}

我怎样才能得到一个将这两个结合起来的回答?输出应如下所示:

^{pr2}$

尝试使用响应1+response1=responsei追加响应。在


Tags: nameflaskjohnmaryjsonifystudentspr2teachers

热门问题