python setup.py --help-commands
How to install Python modules:
1. Single-file module: copy the file directly to $python_dir/lib
2. Multi-file module with setup.py: python setup.py install
3. egg file, similar to Java jar:
1) Download ez_setup.py, run python ez_setup
2) easy_install *.egg
Although Python modules can be copied and installed, it is generally recommended to make an installation package, that is, write a setup.py file to install.
Use of the setup.py file:
% python setup.py build #compile
% python setup.py install #install
% python setup.py sdist #make distribution package
% python setup.py bdist_wininst #make distribution package under windows
% python setup. Writing of py bdist_rpm
setup.py file:
Setup.py mainly executes a setup function, most of which are descriptive things, the most important is the packages parameter, which lists all packages, and can use the built-in find_packages to dynamically obtain packages. So the writing of the setup.py file is actually very simple.