>> If you want these to be loaded dynamically from the file system you
>> might want to use include_files to simply copy the files to the target
>> directory and adjust sys.path in your script to include whatever place
>> you copied these.
>>
>> Recognize one other thing: Executable() is meant for overriding stuff
>> that you want different in each executable. If you only have one
>> executable or they all use the same configuration you're better off
>> simply using the main setup() call.
>
>
> I built my plugin system from a tutorial on the internet, and they
> have this file in plugin/__init__.py, which is used later to
> initialize all python files from a directory:
>
> __all__ = [fnm[:-3] for fnm in os.listdir(__path__[0]) if
> fnm.endswith(".py") and not fnm.startswith("_")]
>
> Now, I guess when I freeze it, I can no longer add or remove plugins,
> so I have a few options:
>
> 1. Detect that I am frozen, and set __all__ manually if so. Is there a
> variable set for this?

Yes. When frozen the variable sys.frozen is set. You could also check
the value of sys.executable which will be different when running from
a Python script as opposed to an executable.

> 2. If it's possible, place the plugins in an external path that can be
> modified. This would allow for installing/removing plugins. Am I able
> to do this without Python installed on a computer?

Certainly. The frozen executable has a Python interpreter built in so
it can quite happily load any Python script you give it -- provided
that the modules that it references are already included in your
library.zip. That means you have to use the includes directive for all
modules that you don't use in the core but which you might possibly
wish to use in a plugin. Make sense?

>> Hope that helps!
>
> You've been a great help! I really appreciate your time. I hope I
> haven't been too much trouble.

You're welcome. You haven't been too much trouble. That's not an
invitation to try harder, though! :-)

Anthony

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to