Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用<;输入>;在烧瓶中的for循环中?_Python_Html_For Loop - Fatal编程技术网

Python 如何使用<;输入>;在烧瓶中的for循环中?

Python 如何使用<;输入>;在烧瓶中的for循环中?,python,html,for-loop,Python,Html,For Loop,嘿,伙计们,我在Flask中的HTML文件中有一些按钮,我想返回一些其他按钮作为对第一个按钮的响应。例如,首先,用户看到“文档”、“供应商”和“方法”按钮,然后当用户单击文档时,他/她将看到其他3个按钮“文档1”、“文档2”和“文档3”。对于第二个按钮,我正在尝试为烧瓶中的循环使用,但它不起作用 {% if l %} <form id="buttons" action="POST"> {% for i in li %} <input ty

嘿,伙计们,我在Flask中的HTML文件中有一些按钮,我想返回一些其他按钮作为对第一个按钮的响应。例如,首先,用户看到“文档”、“供应商”和“方法”按钮,然后当用户单击文档时,他/她将看到其他3个按钮“文档1”、“文档2”和“文档3”。对于第二个按钮,我正在尝试为烧瓶中的循环使用,但它不起作用

{% if l %}
<form id="buttons" action="POST">
{% for i in li %}
<input type="submit" name={{i}} value={i}} class='btn btn-primary'>
{% endfor %}
</form>
{% endif %}
{%if l%}
{li%中的i为%i}
{%endfor%}
{%endif%}

我刚开始使用Flask,我不知道如何解决这个问题。非常感谢您的帮助。

您可以使用for循环,如本例所示,我一直在使用:

{% extends "layout.html" %}
{% block content %}
    <form style="text-align:center;" name="goterms_id_select" id="goterms_id_select" action="/InteractionMaps/ByGene/showInxMapByGene/" method="POST">
        <label> COMPARISONs </label>
        <br>
        <select name="comparison_id_select" class="selectpicker form-control" style="width:120px;height:25px;text-align:center;">
          {% for first_selection in first_selections %}
            <option value="{{ first_selection.name }}">{{ first_selection.name }}</option>
          {% endfor %}
        </select>
        <br><br>
        <label> Gene NAME </label>
        <br>
        <input type="text" name="gene_name_select" style="width:200px;">
        <br>
        <input type="submit" value="submit">
    </form>
{% endblock %}
{%extends“layout.html”%}
{%block content%}
比较

{first_selections%中的first_selections%为% {{first_selection.name} {%endfor%}

基因名

{%endblock%}

您可以找到此html的页面

是否需要此工作

(函数(){
"严格使用",;
//这个函数是严格的。。。
}());
//默认情况下隐藏BTN
document.getElementById('hidden_btn_document_1')。style.display='none';
document.getElementById('hidden_btn_document_2')。style.display='none';
//使按钮仅在单击文档btn时可见;
document.getElementById('document_btn')。addEventListener('click',function(){
//显示基站
document.getElementById('hidden_btn_document_1')。style.display='block';
document.getElementById('hidden_btn_document_2')。style.display='block';
});

文件
供应商
方法

文件1 文件2