[Distutils] Adding entry points into Distutils ?

Paul Moore p.f.moore at gmail.com
Thu May 7 16:03:29 CEST 2009

2009/5/7 Doug Hellmann <doug.hellmann at gmail.com>:
> I write a python script call hello.py like this:
>        #!/usr/bin/env python
>        def main():
>                print 'hello!'
>        if __name__ == '__main__':
>                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 "hello.py".

That works but a lot of Unix users have in the past objected to having
'.py' in the name. People then start trying to cater for them by
leaving off the '.py', which means it doesn't work on Windows, etc

As a Windows user, I'm all in favour of this. But can you persuade the
Unix users to agree with me, please? :-)

> Does setuptools give me something extra for Windows?  I'm not a regular
> Windows user, so it's likely that there are features I don't know about.

I don't think so, as such. It gives Unix and Windows users who care
(== not me, and clearly not you, either) the ability to call the
command "hello" rather than "hello.py".


More information about the Distutils-SIG mailing list