素材牛VIP会员
调用api输出页面,会有标签出现,请问如何清掉?
 想***儿  分类:Python  人气:822  回帖:1  发布于6年前 收藏

调用api输出资料,会有
标签的出现,见截图。请问如何清除?

在做一个表单,以下是输出页面的代码

@app.route('/search4', methods=['POST'])
def do_search() -> 'html':
    hero_name = request.form['input_hero_name']
    output_prompt_error = '请输入正确的英雄名'
    dict_hero = get_dict_hero(hero_name)
    if 'error' in dict_hero:
        return render_template('entry.html',
                               the_entry_title='英雄联盟英雄信息',
                               the_output_prompt_error=output_prompt_error,
                               )
    else:
        return render_template('results.html',
                               the_name=hero_name,
                               output_skill_passive_name = dict_hero['data'][0]['passive']['name'],
                               output_skill_passive_description = dict_hero['data'][0]['passive']['description'],
                               output_skill_1_name = dict_hero['data'][0]['spells'][0]['name'],
                               output_skill_1_tooltip = dict_hero['data'][0]['spells'][0]['tooltip'],
                               output_skill_2_name = dict_hero['data'][0]['spells'][1]['name'],
                               output_skill_2_tooltip = dict_hero['data'][0]['spells'][1]['tooltip'],
                               output_skill_3_name = dict_hero['data'][0]['spells'][2]['name'],
                               output_skill_3_tooltip = dict_hero['data'][0]['spells'][2]['tooltip'],
                               output_skill_4_name = dict_hero['data'][0]['spells'][3]['name'],
                               output_skill_4_tooltip = dict_hero['data'][0]['spells'][3]['tooltip'],
                               )
 标签:apipython

讨论这个帖子(1)垃圾回帖将一律封号处理……

Lv5 码农
阿***7 产品经理 6年前#1
{{变量|safe}}
 文明上网,理性发言!   😉 阿里云幸运券,戳我领取