On mar, 2009-01-13 at 09:45 -0800, IRLStephen wrote: > I wonder is this possible... > > I want one of the python source files in my project to be visible and > editable by the user. If I use pyinstaller, this is not the case > obviously as the python source files are all rolled up into the > executable. > > Is there a way to specify that a particular source file should be > excluded from being included in the executable? > > I tried just copying the .py file into the dist* directory, but the > app seems to be still picking the version of the file that was > compiled into the executable.
Just add the module's name (not filename) to the excludes list by hand-editing the spec file. So, if your file is called "foobar.py" and you import it with "import foobar", modify your exclude list to: excludes = ["foobar"] Then it's your task to obviously ship that file together with the executable that PyInstaller adds. Generically speaking, PyInstaller does not *prevent* imports from looking at source files on the disk (outside the executable). It's just that imports first look within the executable; and since everything needed is in there, they never look outside. But if you exclude certain files from the executable that is being built, the imports will normally search for them even outside the executable and thus on the disk. -- Giovanni Bajo Develer S.r.l. http://www.develer.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "PyInstaller" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/PyInstaller?hl=en -~----------~----~----~----~------~----~------~--~---
