code: def module_path():
      
  
      if we_are_frozen():
          return os.path.dirname(
                  unicode(sys.executable, sys.getfilesystemencoding()))
  
      return os.path.dirname(unicode(__file__, sys.getfilesystemencoding()))
docs: This will get us the program's directory,
      even if we are frozen using py2exe. From WhereAmI page on py2exe wiki.