Skip to content

[3.10] bpo-30757: Improve "How to make stand-alone binaries" FAQ (GH-26309) #26311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Static type checkers such as `Mypy <http://mypy-lang.org/>`_,
source code.


.. _faq-create-standalone-binary:

How can I create a stand-alone binary from a Python script?
-----------------------------------------------------------

Expand All @@ -89,14 +91,15 @@ only contains those built-in modules which are actually used in the program. It
then compiles the generated C code and links it with the rest of the Python
interpreter to form a self-contained binary which acts exactly like your script.

Obviously, freeze requires a C compiler. There are several other utilities
which don't:

* `py2exe <http://www.py2exe.org/>`_ for Windows binaries
* `py2app <https://github.com/ronaldoussoren/py2app>`_ for Mac OS X binaries
* `cx_Freeze <https://cx-freeze.readthedocs.io/en/latest/>`_ for cross-platform
binaries
The following packages can help with the creation of console and GUI
executables:

* `Nuitka <https://nuitka.net/>`_ (Cross-platform)
* `PyInstaller <http://www.pyinstaller.org/>`_ (Cross-platform)
* `PyOxidizer <https://pyoxidizer.readthedocs.io/en/stable/>`_ (Cross-platform)
* `cx_Freeze <https://marcelotduarte.github.io/cx_Freeze/>`_ (Cross-platform)
* `py2app <https://github.com/ronaldoussoren/py2app>`_ (macOS only)
* `py2exe <http://www.py2exe.org/>`_ (Windows only)

Are there coding standards or a style guide for Python programs?
----------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions Doc/faq/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ offender.
How do I make an executable from a Python script?
-------------------------------------------------

See `cx_Freeze <https://cx-freeze.readthedocs.io/en/latest/>`_ and
`py2exe <http://www.py2exe.org/>`_, both are distutils extensions
that allow you to create console and GUI executables from Python code.
See :ref:`faq-create-standalone-binary` for a list of tools that can be used to
make executables.


Is a ``*.pyd`` file the same as a DLL?
Expand Down