From: <th...@us...> - 2014-05-08 19:55:07
|
Revision: 741 http://sourceforge.net/p/py2exe/svn/741 Author: theller Date: 2014-05-08 19:55:04 +0000 (Thu, 08 May 2014) Log Message: ----------- README.rst updates. Modified Paths: -------------- trunk/py2exe-3/README.rst Added Paths: ----------- trunk/py2exe-3/publish/ Property Changed: ---------------- trunk/py2exe-3/ trunk/py2exe-3/py2exe/ Index: trunk/py2exe-3 =================================================================== --- trunk/py2exe-3 2014-05-08 18:40:18 UTC (rev 740) +++ trunk/py2exe-3 2014-05-08 19:55:04 UTC (rev 741) Property changes on: trunk/py2exe-3 ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +dist +build Modified: trunk/py2exe-3/README.rst =================================================================== --- trunk/py2exe-3/README.rst 2014-05-08 18:40:18 UTC (rev 740) +++ trunk/py2exe-3/README.rst 2014-05-08 19:55:04 UTC (rev 741) @@ -2,10 +2,13 @@ =================== `py2exe` is a distutils extension which allows to build standalone -Windows executable programs from Python scripts; Python 3.3 and Python -3.4 are supported. +Windows executable programs (32-bit and 64-bit) from Python scripts; +Python 3.3 and Python 3.4 are supported. It can build console +executables, windows (GUI) executables, windows services, and DLL/EXE +COM servers. -`py2exe` for ``Python 2`` is available at http://sourceforge.net/project/showfiles.php?group_id=15583 +py2exe for Python 2 is still available at +http://sourceforge.net/project/showfiles.php?group_id=15583. .. contents:: @@ -13,12 +16,15 @@ News ---- + Create an exe-file with a simple command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In addition to you beloved setup.py scripts, there is now a -command-line utility which allows to build the exe without any effort: +In addition to your beloved setup.py scripts :-), there is now also a +command-line utility which allows to build the exe without any effort. +Running + :: py -3.3 -m py2exe.build_exe myscript.py @@ -32,9 +38,9 @@ will create an executable `myscript.exe` in the `dist` subdirectory. -If you add the ``-W <setup-script.py>`` switch to the command line it -will write a *commented* ``setup.py`` script for you, which can be -customized further: +If you add the ``-W <setup-script.py>`` switch to the above command +line a *commented* ``setup.py`` script will be generated which can be +used to further customize the exe: :: @@ -119,19 +125,20 @@ relative pathname of the python archive -b option, --bundle-files option - How to bundle the files. 3 - create an .exe, a zip- - archive, and .pyd files in the file system. 2 - create - .exe and a zip-archive that contains the pyd files. + How to bundle the files: + 3 - create script.exe, python.dll, extensions.pyd, others.dll. + 2 - create script.exe, python.dll, others.dll. + 1 - create script.exe, others.dll. + 0 - create script.exe. -W setup_path, --write-setup-script setup_path Do not build the executables; instead write a setup script that allows further customizations of the build process. - --service modname + -svc svnmodule, --service svcmodule The name of a module that contains a service - Using a setup-script -------------------- @@ -140,6 +147,105 @@ switches are the same as before; but they are *NOT* compatible with the command-line switches for the builder mentioned above. +Documentation about the setup-script and other usage tips are in the +wiki pages at http://www.py2exe.org. + + +The bundle-files option explained +--------------------------------- + +The applications that py2exe creates will always need the following +parts: + +1. The exe-file(s) itself. py2exe can build several executables at the + same time; this is especially useful if these are related to each + other since some parts can be shared. +2. The python-dll. +3. The pure python modules needed to run the app. The byte-code for these + modules is always packed into a zip-archive. +4. Compiled python-extension modules. +5. Supporting dlls, if any. + +The bundle-files option determines how these files are packed together +for your application. This is explained with a script ``test_sqlite.py`` +that simply contains this code: + +:: + + import sqlite3 + print(sqlite3) + +The command to build the exe-file is: + +:: + + py2exe.build_exe test_sqlite.py -c --bundle-files <option> + +The ``-c`` option specifies to create a compressed zip-archive. + +``--bundle-files 3`` is the simplest way. These files will be +created in a ``dist`` subdirectory, about 8 MB total size: + +:: + + test_sqlite.exe + _bz2.pyd + _ctypes.pyd + _hashlib.pyd + _lzma.pyd + _socket.pyd + _sqlite3.pyd + _ssl.pyd + _win32sysloader.pyd + pyexpat.pyd + python34.dll + pywintypes34.dll + select.pyd + sqlite3.dll + unicodedata.pyd + win32api.pyd + win32evtlog.pyd + +The zip-archive is appended to the test_sqlite.exe file itself, which +has a size of 1.5 MB in this case. + +``--bundle-files 2`` will include all the Python extensions into the +appended zip-archive; they are loaded via special code at runtime +*without* being unpacked to the file-system. The files in the +``dist`` directory now are these: + +:: + + test_sqlite.exe + python34.dll + sqlite3.dll + +``--bundle-files 1`` will additionally pack the python-dll into the +zip-archive: + +:: + + test_sqlite.exe + sqlite3.dll + +``--bundle-files 0`` now finally creates a real single-file executable +of 6 MB: + +:: + + test_sqlite.exe + +If you are building several related executables that you plan to +distribute together, it may make sense to specify a zip-archive shared +by all the exes with the ``--library libname`` option. The +executables will then become quite small (about 25 kB), since nearly +all code will be in the separate shared archive. + +*Note that not all applications will work with ``bundle-files`` set to +0 or 1*. Be sure to test them. + + + Bugs ---- Index: trunk/py2exe-3/publish =================================================================== --- trunk/py2exe-3/publish 2014-05-08 18:40:18 UTC (rev 740) +++ trunk/py2exe-3/publish 2014-05-08 19:55:04 UTC (rev 741) Property changes on: trunk/py2exe-3/publish ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,2 ## +dist +__pycache__ Index: trunk/py2exe-3/py2exe =================================================================== --- trunk/py2exe-3/py2exe 2014-05-08 18:40:18 UTC (rev 740) +++ trunk/py2exe-3/py2exe 2014-05-08 19:55:04 UTC (rev 741) Property changes on: trunk/py2exe-3/py2exe ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +__pycache__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |