[Distutils] Adding entry points into Distutils ?
doug.hellmann at gmail.com
Fri May 8 00:54:48 CEST 2009
On May 7, 2009, at 5:53 PM, Ben Finney wrote:
> Doug Hellmann <doug.hellmann at gmail.com> writes:
>> I write a python script call hello.py like this:
>> #!/usr/bin/env python
>> def main():
>> print 'hello!'
>> if __name__ == '__main__':
>> Why make me define an entry point for that? I can just put it in
>> /usr/ bin or somewhere in the path on Windows and call it as
> To address the issue raised elsewhere in this thread:
> Why should the name of a *command* include the suffix ‘.py’? That just
> begs for the situation down the line where one of these commands is
> being used widely, by the name ‘hello.py’, and then someone wants to
> provide an alternative implementation in another language.
I personally don't care if it includes the .py suffix or not, most of
the time. I tend not to include it in my own code, and don't get bent
out of shape if someone else's tool does use it. Of course, as I've
been reminded in this thread not including the .py (and not using
entry points) means my "scripts" don't work as-is when installed on
More information about the Distutils-SIG