如何在特定的html标记中显示python结果?
我希望将python结果显示为站点上的特定HTML标记。我该怎么做 获取结果的代码:如何在特定的html标记中显示python结果?,python,html,Python,Html,我希望将python结果显示为站点上的特定HTML标记。我该怎么做 获取结果的代码: # To print All cases for all countries in from all past days in EU. Cases = sum(map(lambda x: int(x['cases']), json.loads(data)['records'])) print(Cases) # To print All deaths for all countries in from all
# To print All cases for all countries in from all past days in EU.
Cases = sum(map(lambda x: int(x['cases']), json.loads(data)['records']))
print(Cases)
# To print All deaths for all countries in from all past days in EU.
Deaths = sum(map(lambda x: int(x['deaths']), json.loads(data)['records']))
print(Deaths)
结果是:
31397816
701325
html代码:
<h2 class="u-custom-font u-text u-text-black u-text-font u-text-1">Total Active Cases</h2>
<h3 class="u-text u-text-2" data-animation-name="counter" data-animation-event="scroll" data-animation-duration="3000" style="will-change: contents;">63</h3>
<a href="Cases.html#sec-f85d" data-page-id="181623978" class="u-btn u-btn-rectangle u-button-style u-palette-1-base u-btn-1">learn more</a>
</div>
</div>
</div>
</div>
<div class="u-size-30">
<div class="u-layout-row">
<div class="u-container-style u-layout-cell u-left-cell u-size-30 u-layout-cell-3">
<div class="u-container-layout u-container-layout-3">
<h2 class="u-align-left u-custom-font u-text u-text-custom-color-3 u-text-font u-text-3">
<span style="font-weight: 700;" class="u-text-black">Total Closed Cases</span>
<br>
</h2>
<h3 class="u-align-center u-text u-text-4" data-animation-name="counter" data-animation-event="scroll" data-animation-duration="3000" style="will-change: contents;">57842</h3>
<a href="Cases.html#sec-f85d" data-page-id="181623978" class="u-btn u-btn-rectangle u-button-style u-palette-1-base u-btn-2">learn more</a>
</div>
</div>
活动案例总数
63
结案总数
57842
结果应该出现在
中。您是否要向我们显示输入数据?您必须使用后端框架来完成此操作。正如您用Python编写代码一样,Flask应该是您最明显的选择