forked from sculove/QWebview-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwnd.py
39 lines (34 loc) · 1.16 KB
/
wnd.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
#!/usr/bin/env python
#-*-coding: utf-8 -*-
import sys
import os.path
from PyQt4.QtCore import *
from PyQt4.QtGui import QWidget, QSplitter, QVBoxLayout, QApplication
from plus.kiwoom import KiwoomWebViewPlus
class Window(QWidget):
def __init__(self):
super().__init__()
self.setMinimumSize(1024, 600)
self.setWindowTitle("QWebview-plus for Kiwoom")
self.view = KiwoomWebViewPlus()
self.splitter = QSplitter(self)
self.splitter.setOrientation(Qt.Horizontal)
layout = QVBoxLayout(self)
layout.setMargin(0)
layout.addWidget(self.splitter)
self.splitter.addWidget(self.view)
self.splitter.addWidget(self.view.webInspector)
if __name__ == "__main__":
if len(sys.argv) < 2:
entryfle = "index.html" if os.path.isfile("index.html") else ""
else:
entryfle = sys.argv[1]
if entryfle:
app = QApplication(sys.argv)
window = Window()
# window.view.setHtml(open(entryfle, encoding="utf8").read())
window.view.load(QUrl(entryfle))
window.show()
app.exec_()
else:
print("진입 페이지를 지정해 주세요")