1 に答える
1
Use either
distribute
orsetuptools
, the former is a fork of the latter, with some improvements and better documentation. Either one is a big step up fromdistutils
, which is part of the python standard library.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
andbar
would be scripts that you can call on the command line. The indicated function will be called withsys.argv[1:]
as the first and only argument.Let the installation tools take care of that; it works fine on Windows. :-)
于 2012-11-14T13:21:03.127 に答える