-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_client.py
53 lines (43 loc) · 1.31 KB
/
gui_client.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
42
43
44
45
46
47
48
49
50
51
from PyQt5.QtCore import QUrl, QDir
from PyQt5.QtGui import QFontDatabase
from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage
from PyQt5.QtWidgets import QApplication
from PyQt5 import QtWebEngineWidgets
from PyQt5 import QtCore
from gui_client.socket_client import SocketClient
from gui_client.gui import MainWindow
#from signal import signal, SIGPIPE, SIG_IGN
#signal(SIGPIPE, SIG_IGN)
def test_qt():
#header='<meta charset="UTF-8"/>\n'
_,record=lookup("mouse")
#print(QDir.currentPath())
#print(record)
#record=header+record
app=QApplication([])
set_default_font()
view = QtWebEngineWidgets.QWebEngineView()
page=MyWebPage()
view.setPage(page)
baseUrl = QUrl.fromLocalFile(QDir.currentPath() + "/index.html")
print(baseUrl)
page.setHtml(record,baseUrl)
#view.load(QUrl("file://t.html"))
#load_css_js_from_file('css',view,"LDOCE6.css","ld6")
#load_css_js_from_file('js',view,"entry.js","entry")
view.show()
app.exec_()
def test_window():
app=QApplication([])
ex=MainWindow()
app.exec()
def test_client():
q=QUrl("entry: abc")
print(q.toString().split(":")[1].strip("/ "))
print(q.scheme())
print(q.host())
print(q.path())
print(q.fragment())
if __name__ == '__main__':
#output(300)
test_window()