title: Passing parameters - Python to HTML with Javascript
body: <p>I have a simple Python file which uses the QtWebkit.QWebView to display a google maps page.</p>
  
  <p>This is done by calling the HTML which includes some java script.</p>
  
  <p>What I don't know how to do is get the co-ordinates from Python to the java script in the HTML file.</p>
  
  <p>Perhaps someone can point me in the right direction?</p>
  
  <p>PYTHON:</p>
  
  <pre><code>class MainWin(QDialog,MainFrm.Ui_MainWin):
      def __init__(self, parent=None):
          super(MainWin,self).__init__(parent)
          self.setupUi(self)
  
  
          self.lat = -25.723146
          self.long = 28.267628
          self.GMapWidget.load("markers.html?",coords = self.lat)
  
  
  
  app = QApplication(sys.argv)
  frm=MainWin()
  frm.show()
  app.exec_()
  </code></pre>
  
  <p><strong><em>HTML:</em></strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;style type="text/css"&gt;
        html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
      &lt;/style&gt;
      &lt;script type="text/javascript"
        src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCrRTR8nZX3m6g_nYbilamyKSBHx9QUdfw"&gt;
      &lt;/script&gt;
      &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;style type="text/css"&gt;
        html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
      &lt;/style&gt;
      &lt;script type="text/javascript"
        src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCrRTR8nZX3m6g_nYbilamyKSBHx9QUdfw"&gt;
      &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        lt = -25.723146
        ln = 28.267628
        function initialize() {
          var mapOptions = {
            center: { lat: lt, lng:  ln},
            zoom: 8
          };
          var map = new google.maps.Map(document.getElementById('map-canvas'),
              mapOptions);
        }
        google.maps.event.addDomListener(window, 'load', initialize);
  
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
  &lt;div id="map-canvas"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
    &lt;/head&gt;
    &lt;body&gt;
  &lt;div id="map-canvas"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>