def show_map(bcity): """Shows a map in your default browser with sites marked""" print('\n---> Gerar Visualizacao Grafica dos Scores obtidos por Site de Localizacao\n') zoom=int(eval(input('Zoom(4):'))) tmap = PyMap() tmap.maps[0].center = (46.0000,7.0000) tmap.key='AIzaSyCj-UAqhnY-fhkeCEayjALakrGJMgcaQ6A' tmap.maps[0].zoom = zoom blue_icon = Icon('blue_icon') blue_icon.image = "http://www.clker.com/cliparts/B/B/1/E/y/r/marker-pin-google-md.png" blue_icon.iconSize = (15,25) tmap.addicon(blue_icon) red_icon = Icon('red_icon') red_icon.image = "http://www.clker.com/cliparts/e/3/F/I/0/A/google-maps-marker-for-residencelamontagne-md.png" red_icon.iconSize = (15,25) tmap.addicon(red_icon) file=open('coords.csv','r') reader=csv.reader(file) for row in reader: if row[0]==bcity: p=[row[1],row[2],row[0][3:],'blue_icon'] tmap.maps[0].setpoint(p) else: p=[row[1],row[2],row[0][3:],'red_icon'] tmap.maps[0].setpoint(p) file.close() open('mymap.html','w').write(tmap.showhtml()) filepath = os.path.abspath('mymap.html') webbrowser.open('file://' + filepath) return '\nMapa guardado!'