diff --git a/vnpy/event/eventEngine.py b/vnpy/event/eventEngine.py index a89c924e..f8b85aa4 100644 --- a/vnpy/event/eventEngine.py +++ b/vnpy/event/eventEngine.py @@ -1,7 +1,7 @@ # encoding: UTF-8 # 系统模块 -from Queue import Queue, Empty +from queue import Queue, Empty from threading import Thread from time import sleep from collections import defaultdict @@ -10,8 +10,7 @@ from collections import defaultdict from qtpy.QtCore import QTimer # 自己开发的模块 -from eventType import * - +from vnpy.event.eventType import * ######################################################################## class EventEngine(object): @@ -336,12 +335,12 @@ def test(): """测试函数""" import sys from datetime import datetime - from PyQt4.QtCore import QCoreApplication + from qtpy import QtWidgets,QtCore def simpletest(event): - print u'处理每秒触发的计时器事件:%s' % str(datetime.now()) + print( u'处理每秒触发的计时器事件:%s' % str(datetime.now())) - app = QCoreApplication(sys.argv) + app = QtWidgets.QApplication([]) ee = EventEngine2() #ee.register(EVENT_TIMER, simpletest) diff --git a/vnpy/event/eventType.py b/vnpy/event/eventType.py index 014d930b..c1c4a5b2 100644 --- a/vnpy/event/eventType.py +++ b/vnpy/event/eventType.py @@ -30,12 +30,11 @@ def test(): for key, value in check_dict.items(): if len(value)>1: - print u'存在重复的常量定义:' + str(key) + print(u'存在重复的常量定义:' + str(key) ) for name in value: - print name - print '' + print(name) - print u'测试完毕' + print( u'测试完毕') # 直接运行脚本可以进行测试