[Tutor] Packaging questions

Alan Gauld alan.gauld at yahoo.co.uk
Sun Dec 12 06:17:59 EST 2021



Sent from my iPad

> What should I do if I want my pip installation to be a command line
> application instead of an importable library of functions? Do I need a more
> sophisticated setup.py file which installs an executable in usr/bin or
> something?

You do know about the 

if __name__ == “__main__”:

Idiom for making a module executable, right?

That means an executable script and a module are the same thing.
The only other requirement is that the user has a compatible python installed.

If you are looking at installing python as well then you might be better off looking at tools like py2exe for windows, or similar tools for other OS…


More information about the Tutor mailing list