Created
June 18, 2014 00:08
-
-
Save rafael-neri/3cbff0f989f12f805084 to your computer and use it in GitHub Desktop.
Kaiana Webapps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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