Cross-platform way to get default directory for binary files like console scripts?

Piotr Dobrogost p at google-groups-2014.dobrogost.net
Thu Feb 20 16:34:25 CET 2014


On Thursday, February 20, 2014 4:22:53 PM UTC+1, Oscar Benjamin wrote:
> 
> I'm not sure if I understand the question. Are you trying to find
> where a script would go if it had been installed as a result of
> 'python setup.py install' or 'pip install ...'? 

> Yes.

> If so there are
> different places it could go depending not only on the system but also
> how the packages were installed (e.g. --user).

Right.

> You can find the default location in this roundabout way:
>
> (...)
> 
> In [5]: c.install_scripts
> Out[5]: '/usr/local/bin'

I think this is pretty much what I'm after, thanks.
I'm wondering if there's some API to get this info as what you showed is really roundabout way to achieve the goal...

Regards,
Piotr



More information about the Python-list mailing list