2009/7/27 mhearne808 <[email protected]>:
> My questions:
>  - Is it possible to embed a script with a "main" entry point in an
> egg, and run that from the command line?
>  - If so, how do you pass command line arguments to that main?
>  - Is this a massive abuse of the intended usage of setuptools?

In Python 2.6, you can definitely use a zip file like this. See
http://docs.python.org/using/cmdline.html#command-line

    python foo.zip arg1 arg2 ...

foo.zip should contain a __main__.py which is run. sys.argv holds the
arguments as usual.

This is not an abuse, it's a standard feature.

Whether this is possible with eggs is another matter. I don't know the
answer to this, beyond saying that eggs are zip format files, so you
can always do it as above, at a pinch (assuming you can force
setuptools to generate the correct layout).

Paul.
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to