How to distribute py-scripts on windows without requiring the full ActivaState package

David LeBlanc whisper at oz.net
Mon Jun 17 17:35:57 EDT 2002


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of DV
> Sent: Monday, June 17, 2002 12:51
> To: python-list at python.org
> Subject: How to distribute py-scripts on windows without requiring the
> full ActivaState package
>
>
> Hello,
>
> A couple of years ago, I experimented with Python on Linux, but
> somehow got out of touch.
>
> Just recently I discovered, that there is a pretty comprehensive
> Windows-Version for it that even supports pure windows-stuff such as
> COM or Win32API.
>
> Yet, I found out that the ActiveState package is very large to
> download and install, so this leads me to the question(s):
>
> 1)Is there some way to distribute a script foo.py by maybe bundling it
> with python.exe and python.dll, delivering these three files ONLY (and
> of course any .py library files that foo.py calls) and not requiring
> the recipient to download and install the whole ActiveState package?

The "standard" Python distribution lives at www.python.org, and doesn't
include the PythonWin Win32 extensions. It's smaller.

There are 3rd party packages like Py2Exe that bundle python, required
libraries and scripts into a single .exe file. You can find out a lot more
about distributing Python apps at http://www.mcmillan-inc.com/install1.html

> 2)Are there different versions of python.exe and python.dll? What I
> would find useful was, if there was ONE version of
> python.exe&python.dll that only could be used for console stuff, so
> you wouldn´t have such big files to distribute along with foo.py, and
> another one for true GUI-stuff

Python.exe is used for console mode programs and Pythonw.exe is used for GUI
applications that don't need a console window. Python.exe can also be used
for GUI programs, but then you get a console window in addition to your GUI
window(s).

> 3)Concerning COM and other heftier Win32 dependend stuff, or anything
> that python needs a third-party dll for to use: Can the necessary dll
> be bundled along with python.exe, python.dll and foo.py, just as
> mentioned in 1)?

Yes

> Mind, I would´t want to distribute stuff as a single EXE. I could live
> with having to distribute more than one file, but I would very much
> like it, if an end user receiving my script would´t have to install
> the whole ActiveState package.

If you don't mind distributing a .zip file containing your app, distutils
(part of the Python distribution) can help you create installation scripts.
There are other alternatives like the Wise Installer ($) and InoSetup
(free).

> I could imagine that one weak point about this is, that i have read
> somewhere that dlls must be registered before they are usable, but I
> also read that this is possible by using rundll.exe or some other
> Windows system program manually. If so, the registering process could
> be done by a .BAT file.

Only dlls containing COM components need to be pre-registered. A regular dll
only needs to be found in the path or PYTHONPATH, or in the directory
containing the .exe file that's trying to use it.

> As for the harddisk-space penalty of havin more than one python.exe
> and python.dll (one for each distributed script), this is the reason
> why I asked, whether a console version exists: If it did exist, you
> could do the GUI by designing a HTML-page that drives it.

Python is independent of it's GUI components. If you don't use them, you
don't have to distribute them. If you do, then you'll have a larger .zip or
.exe file. If you know you're going to use several scripts, then it makes
sense to just download and install a standard distribution of Python that
all the scripts can share.

> Sorry, if this posting appears twice under different topics, if so, it
> is most likely a temporary fault of deja.com, through which I posted
> this.
>
> I would appreciate any info on this matter.
>
> Thank you in advance,
> Bye.
> Franz

Dave LeBlanc
Seattle, WA USA






More information about the Python-list mailing list