-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUI.py
executable file
·64 lines (47 loc) · 1.53 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import sys
import Tabs
import os
from PySide import QtGui
import yfinance
class GUI(QtGui.QMainWindow):
def __init__(self):
super(GUI, self).__init__()
print "starting to run..1"
self.initUI()
def initUI(self):
print "starting to run..2"
"""try:
yfinance.get_price('aapl')
except:
error = QtGui.QErrorMessage()
error.showMessage('Error Establishing Internet Connection')
error.exec_()
self.destroy()
return """
print "starting to run..3"
tabs = Tabs.Tabs()
self.setCentralWidget(tabs)
exitAction = QtGui.QAction('Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(self.close)
exitAction.setMenuRole(QtGui.QAction.MenuRole.ApplicationSpecificRole);
menubar = self.menuBar()
fileMenu = menubar.addMenu('&File')
tabs.addMenuItems(fileMenu)
fileMenu.addSeparator()
fileMenu.addAction(exitAction)
self.setWindowTitle('TradeUp')
self.setMinimumSize(900,600)
self.showFullScreen()
self.showMaximized()
self.setAcceptDrops(True)
self.show()
def main():
QtGui.QApplication.setStyle('motif')
app = QtGui.QApplication(sys.argv)
gui = GUI()
sys.exit(app.exec_())
if __name__ == '__main__':
sys.path.append(os.path.realpath(__file__))
main()