support for frozen using cx_freeze

This commit is contained in:
fengyu 2014-08-13 00:22:16 +08:00
parent 6442849519
commit 5534837177

View File

@ -4,7 +4,13 @@
import os, sys
_srcdir = 'src/'
_filepath = os.path.dirname(os.path.realpath(__file__))
if getattr(sys, 'frozen', False):
# The application is frozen
_filepath = os.path.dirname(os.path.realpath(sys.executable))
else:
# The application is not frozen
# Change this bit to match where you store your data files:
_filepath = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(1, os.path.join(_filepath, _srcdir))
if sys.version_info[0] == 3: