Prerequisites:
The Easy-install module needs to be installed, which is a Python module packaging tool.
First download the easy_setup.py source code, download the address:
Http://pypi.python.org/pypi/setuptools
Use Notepad to store the source code with the. py suffix name, execute at the command line, so you can see in the Python installation directory python\scripts This directory there are several files about Easy_install, indicating that this easy_install installed , how should you use this installation method?
Open cmd, command line, into the python\scripts directory, under this directory execute Easy_install python-dateutil, can install dateutil this module, Easy_install Pyparsing can install pyparsing this module.
My machine is:
The execution is OK!
Py2exe Module Installation:
Http://prdownloads.sourceforge.net/py2exe download the corresponding version of the installation package.
Sample code:
Create a new test.py file with the following contents:
Create a new mysetup.py compilation file with the following content:
Run the following command:
>>python mysetup.py Py2exe
Operation Result:
A new dist directory in the current directory contains the following types of files with unequal numbers:
- . exe contains a catalog file
- . PYD compiled py file
- The. dll requires an external DLL file containing a Pythonxx.dll
- . zip needs to use the library file, which packed all the library files need to compile files
View Help:
Sample catalog:
After installing the Py2exe module, its own sample is stored in: lib\site-packages\py2exe\samples
Description
The parameters required to compile different types of binaries are not the same, for example: the command-line program parameter name is the console, and the GUI program's parameter name is Windows, you can refer to the sample or HELP command script first!
Use after feeling:
Originally thought to be converted after the only one EXE file, used to find and did not want to imagine that all the content has been encoded in binary. Hehe, sometimes think of things too ideal, after all, this is the easiest way to achieve the feasible solution!