title: QtWebkit and Flask to make native desktop app
body: <p>I'm new to python. I'm looking for new way to create desktop application by QtWebkit and Flask.</p>
  
  <p>the idea is : rather than open Flask web app on user browser, run and open it on QtWebkit GUI.</p>
  
  <p>I wrote the following code , but it seems wrong. when Flask start running the GUI will be hanged .</p>
  
  <pre><code>import sys
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  from PyQt4.QtWebKit import *
  from flask import Flask
  
  
  app = Flask(__name__)
  
  @app.route("/")
  def hello():
      return "&lt;a href='http://127.0.0.1:5000/test'&gt;AA&lt;/a&gt;&lt;br /&gt;Hello World!"
  
  @app.route('/test')
  def test():
      return 'test'
  
  pyqt = QApplication(sys.argv)
  
  web = QWebView()
  
  
  if __name__ == "__main__":
  
      web.load(QUrl("http://127.0.0.1:5000/"))
      web.show()
      app.run()
      sys.exit(pyqt.exec_())
  </code></pre>