-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI.py
executable file
·41 lines (33 loc) · 1.23 KB
/
GUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtCore import QUrl
from PyQt4.QtWebKit import QWebView
class TestWindow(QtGui.QWidget):
def __init__(self, parent = None):
super(TestWindow, self).__init__(parent)
self.palette = QtGui.QPalette()
self.gridLayout = QtGui.QGridLayout()
self.centralWidget = QtGui.QWidget()
self.button = QtGui.QPushButton("Click")
self.setWindowTitle("UNIX")
self.resize(1200,700)
self.button.clicked.connect(self.clicked)
self.b = QWebView()
self.b.load(QUrl('http://www.google.com'))
IEdit = QtGui.QLineEdit()
self.Trans = QtGui.QTextEdit()
self.gridLayout.addWidget(IEdit,0,0)
self.gridLayout.addWidget(self.button,1,0)
self.gridLayout.addWidget(self.b,2,0)
self.gridLayout.addWidget(self.Trans,3,0)
self.setLayout(self.gridLayout)
def clicked(self):
self.b.load(QUrl('http://yahoo.com.tw'))
self.Trans.setText('HI')
#for line in urlFile:
if __name__ == '__main__':
app = QtGui.QApplication(sys.argv)
ex = TestWindow()
ex.show()
sys.exit(app.exec_())