12 lines
354 B
Python
12 lines
354 B
Python
import os, sys
|
|
|
|
def we_are_frozen():
|
|
# All of the modules are built-in to the interpreter, e.g., by py2exe
|
|
return hasattr(sys, "frozen")
|
|
|
|
def module_path():
|
|
encoding = sys.getfilesystemencoding()
|
|
if we_are_frozen():
|
|
return os.path.dirname(unicode(sys.executable, encoding))
|
|
return os.path.dirname(unicode(__file__, encoding))
|