Skip to content

Instantly share code, notes, and snippets.

@rafael-neri
Created June 18, 2014 00:08
Show Gist options
  • Save rafael-neri/3cbff0f989f12f805084 to your computer and use it in GitHub Desktop.
Save rafael-neri/3cbff0f989f12f805084 to your computer and use it in GitHub Desktop.
Kaiana Webapps
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtWebKitWidgets import QWebView
from PyQt5.QtCore import QUrl
"""
Example: webapps.py http://www.kaiana.com.br/
"""
# Create application QT and create WebView
app = QApplication([])
web = QWebView()
# Set Title
web.setWindowTitle("Kaiana Webapps")
# Configurations: Center Window and Enable extra tools for developers
web.move(app.desktop().screen().rect().center() - web.rect().center())
web.page().settings().setAttribute(QWebSettings.PluginsEnabled, True)
# Get URL and load URL
url = sys.argv[1]
web.load(QUrl(url))
# Show webview
web.show()
# Quit application
sys.exit(app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment