I am using Brython.js I am able to print a loop in HTML browser but as you can see this is adding the output to entire DOM.
How can I append the print result into an specific DOM element? For example if I want to print the output into #map
, how can I do it?
<ul id="maps"></ul>
<script type="text/python">
from browser import document
import sys
sys.stdout = document
maps= ["world", "asia", "africa"]
for x in maps:
print(x)
</script>