展开全部
这里有好几种方法。你自己选自己的平台62616964757a686964616fe58685e5aeb931333363356561
比如windows:(摘取)
py2exe
Write setup.py (List of configuration options):from distutils.core import setup
import py2exe
setup(
windows=[{'script': 'foobar.py'}],
)
(Optionally) include icon
(Optionally) one-file mode
Generate .exe into dist directory:$ python setup.py py2exe
Provide the Microsoft Visual C runtime DLL. Two options: globally install dll on target machine or distribute dll alongside with .exe.