doxy doxy - 8 months ago 42
Python Question

QWebView troubling with loading HTML in PyQt4

I've built a little app that loads a map in an QWebView. It works perfect when using Python 3.4 win64...
When I want to execute the same code using Python 2.7 win32. the html file doesn't appear.
Somebody can explain me why it happens and how to resolve it?

#!/usr/bin/env python

import folium
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

mapa = folium.Map(location=[46.3014, -123.7390], zoom_start=7)"test.html")

app = QApplication(sys.argv)
strona = QWebView()


After a little investigation I've found out that the reason of not showing a map is a company policy. When opening a webpage as I’ve got the information that webpage is blocked.

app = QApplication(sys.argv)
strona = QWebView() 

enter image description here When opening a map created by folium there is no information. Not sure why... enter image description here

What’s more I've checked at not-company win32, python 2.7 and the app has worked fine.

Summing up, there is nothing wrong with the code or the python's version. It is the company policy.

Nevertheless it is interesting that I can open or test.html using web browser as like Google Chrome or Internet Explorer....