In article <BANLkTi=-=jjlk_4awqgna3h7kv3aa9y...@mail.gmail.com>, km <srikrishnamo...@gmail.com> wrote: > I am trying to look at the source code of a python script (run.py). But > it reads > ###########code - run.py ######################## > #!/usr/bin/env python > # EASY-INSTALL-SCRIPT: 'pbpy==0.1','run.py' > __requires__ = 'pbpy==0.1' > import pkg_resources > pkg_resources.run_script('pbpy==0.1', 'run.py') > ##############code ##################### > > What are the advantages of using pkg_resources stuff ?
What you are seeing is boiler-plate code automatically generated by setuptools (or the Distribute clone of setuptools) when a script is installed with easy_install. The main reason for the wrapper is to allow multiple versions of a Python "package" (in the PyPi sense) to be installed in one Python instance. There's more information here: http://peak.telecommunity.com/DevCenter/setuptools -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list