0
4

1 に答える 1

1
  1. Use either distribute or setuptools, the former is a fork of the latter, with some improvements and better documentation. Either one is a big step up from distutils, which is part of the python standard library.

  2. You want a console script, for which you define an entry point:

    entry_points = {
        'console_scripts': [
            'foo = my_package.some_module:main_func',
            'bar = other_module:some_func',
        ],
    

    where foo and bar would be scripts that you can call on the command line. The indicated function will be called with sys.argv[1:] as the first and only argument.

  3. Let the installation tools take care of that; it works fine on Windows. :-)

于 2012-11-14T13:21:03.127 に答える