[FRPythoneers] dispatching from a script
josh_johnson at unc.edu
Fri Apr 15 14:44:09 MDT 2011
You may want to take a look at the Paste package, it won't do it for
you, but it implements what you're asking, and also has some sort of
plugin architecture that uses entry points (I think).
relevant source: http://svn.pythonpaste.org/Paste/Script/
On 04/15/2011 01:29 PM, Brent Pedersen wrote:
> hi, not sure if this list is the appropriate venue, but i'll ask anyway.
> so i have a python library and i want to have several scripts but keep
> them in the same name space.
> so i'll have "mymodule" that's importable from python and then i want
> to be able to have console scripts
> $ mymodule action_a --args files
> $ mymodule actoin_b --other_args other_files
> i can do this manually with something like:
> 'console_scripts': ['mymodule = mymodule:main']
> in my setup.py, and dispatching from main() based on sys.argv, but then
> after implementing stuff like having
> $ mymodule
> give a list of available actions, it can get pretty tedious.
> are there idioms or modules in python that make this easier?
> i admit i haven't looked around too much.
> thanks for any pointers,
> This message sent by the FRPythoneers mailing list.
> Unsubscribe: echo unsubscribe | FRPythoneers-request at lists.community.tummy.com
> URL: http://lists.community.tummy.com/mailman/listinfo/frpythoneers
Lineberger Comprehensive Cancer Center
University of North Carolina at Chapel Hill
More information about the FRPythoneers