packaging multiple python scripts as Windows exe file

Den patentsvnc at gmail.com
Wed Apr 14 10:58:23 EDT 2010


On Apr 12, 3:20 pm, Alex Hall <mehg... at gmail.com> wrote:
> Hi all,
> While my project is still suffering from major import problems, I will
> soon have to try to package it as a Windows executable file. I do not
> want an installer; I want the user to be able to run the program for
> as long as they want, then to quit (by using a command from inside the
> program) and that is it. Nothing to install, no files to copy, no
> registry editing, just start and use it until done.
>
> I know about the popular solutions for this sort of thing, but I read
> that a DLL is required, and that this dll cannot be (legally)
> distributed by myself? A few questions here:
> 1. Did I read this wrong / is this outdated? Please answer 'yes' as
> this will be a real pain to deal with.
>
> 2. If I must have it but can distribute it, where should it go so my
> program can find it?
>
> 3. If the user must download it for legal reasons, instead of me
> giving it to them, can I just have a Python script take care of it and
> put it in the same directory as the program, so the program can find
> it, or do I need to register the dll with the system? If I need to
> register, does this require admin login?
>
> Thanks as always!
>
> --
> Have a great day,
> Alex (msg sent from GMail website)
> mehg... at gmail.com;http://www.facebook.com/mehgcap

I'm not an expert, but there is a module called ResourcePackage
(http://resourcepackage.sourceforge.net/) which I have used to include
binary files within my python program (I use it for an image file).
It takes the binary file, makes a string out of it, then generates a
module containing that string.  You can then import that module and
access that string.  In particular, I assume you can write that string
out to a binary file and recreate the binary file.

I know this doesn't address how to make a single exe which a user can
run (I'm interested in the replies you get) but it does allow you to
carry your binary files along with your and write them out when and if
you need them.

By the way, I'd be interested to hear if there are any other such
solutions for embedding binary files in a python program.

Hope that helped.

Den



More information about the Python-list mailing list