python 設定網頁全屏顯示
阿新 • • 發佈:2019-02-11
備註:安裝pyqt
1.sudo apt-get -y install python-qt4
2.sudo apt-get install python-dev
3.sudo apt-get install python-xlib
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file ´E:wwwrootpythonDemoDemo.ui´ # # Created: Sun Feb 19 09:05:26 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(1600, 900) self.centralWidget = QtGui.QWidget(MainWindow) self.centralWidget.setObjectName(_fromUtf8("centralWidget")) self.verticalLayout_2 = QtGui.QVBoxLayout(self.centralWidget) self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.webView = QtWebKit.QWebView(self.centralWidget) self.webSettings = self.webView.settings() self.webSettings.setAttribute(QtWebKit.QWebSettings.PluginsEnabled,True) self.webView.setUrl(QtCore.QUrl(_fromUtf8("http://192.111.21.22"))) self.webView.setObjectName(_fromUtf8("webView")) self.verticalLayout.addWidget(self.webView) self.verticalLayout_2.addLayout(self.verticalLayout) MainWindow.setCentralWidget(self.centralWidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", u"000000", None, QtGui.QApplication.UnicodeUTF8)) from PyQt4 import QtWebKit if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() MainWindow.show() #MainWindow.showFullScreen() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())