Ask coding questions

← Back to all posts
run html with the main repl python
laval (0)
Hello, my program does generate map.html but does not want to launch it from this main. On the other main by doing a copy paste and a new program in html it works!
import folium
import webbrowser

class Map:
def init(self, center, zoom_start): = center
self.zoom_start = zoom_start

def showMap(self):
    #Create the map
    my_map = folium.Map(location =, zoom_start = self.zoom_start)

    #Display the map"map.html")

#Define coordinates of where we want to center our map
lat=input("quelle est la lattitude ? :")
long=input("quelle est la longitude ? :")
zoom1 = input("valeur du zoom ? :")
coords = [lat,long]
map = Map(center = coords, zoom_start = zoom1)

laval (0)

webbrowser.opne_new_tab takes a url as i saw in python docs webbrowser.open_new_tab(url). Well i think you can use python flask. Flask is a web framework where you can use python as a backend. Hope helped you in any way.