diff --git a/examples/CtaTrading/runCtaTrading.py b/examples/CtaTrading/runCtaTrading.py index b34960d9..7f315e08 100644 --- a/examples/CtaTrading/runCtaTrading.py +++ b/examples/CtaTrading/runCtaTrading.py @@ -1,5 +1,9 @@ # encoding: UTF-8 +import sys +reload(sys) +sys.setdefaultencoding('utf8') + import multiprocessing from time import sleep from datetime import datetime, time diff --git a/vnpy/trader/uiMainWindow.py b/vnpy/trader/uiMainWindow.py index 9d97f60d..38f52333 100644 --- a/vnpy/trader/uiMainWindow.py +++ b/vnpy/trader/uiMainWindow.py @@ -112,6 +112,10 @@ class MainWindow(QtWidgets.QMainWindow): appMenu = menubar.addMenu(vtText.APPLICATION) for appDetail in self.appDetailList: + # 如果没有应用界面,则不添加菜单按钮 + if not appDetail['appWidget']: + continue + function = self.createOpenAppFunction(appDetail) action = self.createAction(appDetail['appDisplayName'], function, loadIconPath(appDetail['appIco'])) appMenu.addAction(action)