diff --git a/vn.trader/vtFunction.py b/vn.trader/vtFunction.py index 8ad23936..708de59e 100644 --- a/vn.trader/vtFunction.py +++ b/vn.trader/vtFunction.py @@ -6,7 +6,6 @@ import decimal import json -import sys MAX_NUMBER = 10000000000000 MAX_DECIMAL = 4 @@ -25,9 +24,6 @@ def safeUnicode(value): if abs(d.as_tuple().exponent) > MAX_DECIMAL: value = round(value, ndigits=MAX_DECIMAL) - # Reload sys, Set default encode to UTF8 - reload(sys) - sys.setdefaultencoding('utf8') return unicode(value) #---------------------------------------------------------------------- diff --git a/vn.trader/vtMain.py b/vn.trader/vtMain.py index d0c909e0..554b1fd7 100644 --- a/vn.trader/vtMain.py +++ b/vn.trader/vtMain.py @@ -14,6 +14,10 @@ def main(): if platform.uname() == 'Windows': ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.py demo') + # Reload sys, Set default encode to UTF8 + reload(sys) + sys.setdefaultencoding('utf8') + # 初始化Qt应用对象 app = QtGui.QApplication(sys.argv) app.setWindowIcon(QtGui.QIcon('vnpy.ico'))