Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

packaging multiple python scripts as Windows exe file

3 views
Skip to first unread message

Alex Hall

unread,
Apr 12, 2010, 6:20:09 PM4/12/10
to python-list
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)
meh...@gmail.com; http://www.facebook.com/mehgcap

Mike Driscoll

unread,
Apr 13, 2010, 3:56:43 PM4/13/10
to
> mehg...@gmail.com;http://www.facebook.com/mehgcap


Without knowing the exact DLL you're thinking of, we can't be sure
what the answer is. But I think you're talking about a certain MS DLL
that Python distributes. If so, I've read multiple threads on this
topic that claim that since Python distributes it, there is an implied
permission that you can as well. Since I'm not a lawyer, I can't say
for sure, but the articles I've seen are pretty convincing.

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Joaquin Abian

unread,
Apr 13, 2010, 4:42:39 PM4/13/10
to

the OP probably means MSVCR71.dll that is needed to make single file
executables with py2exe.
This has been discussed elsewhere. Look at http://www.py2exe.org/index.cgi/Tutorial#Step5

joaquin

Alex Hall

unread,
Apr 13, 2010, 4:58:38 PM4/13/10
to pytho...@python.org
msvcr90.dll is the file, and, according to the py2exe tutorial, step
5, I do not have permision to distribute the file. This is not good
news, but beyond that, I apparently get an entire directory with all
required files, not a single .exe which has everything packaged inside
it. Is there another way of compiling Python to .exe which gives me
one file containing all my dlls and Python dependencies? If not then a
folder is not bad, but a single file would be best.

> --
> http://mail.python.org/mailman/listinfo/python-list
>


--
Have a great day,
Alex (msg sent from GMail website)

meh...@gmail.com; http://www.facebook.com/mehgcap

Den

unread,
Apr 14, 2010, 10:58:23 AM4/14/10
to
> mehg...@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

0 new messages