[Distutils] Interrogate distribution for an entry point command path

Ben Finney ben+python at benfinney.id.au
Sat Oct 15 19:38:45 EDT 2016


Thomas Kluyver <thomas at kluyver.me.uk> writes:

> If the entry point looks like:
>
> foo=foomod:main
>
> Then you can invoke it in a subprocess by running:
>
> subprocess.Popen([sys.executable, '-c', 'import foomod; foomod.main()'])

That will invoke the program. I'll probably try that.

One disadvantage there is the process won't have an informative name;
instead of being named ‘/foo/bar/lipsum’, it will be named ‘python’
which is less useful.

> This avoids the need to work out where the 'foo' script has been
> installed to.

So, I'm still wanting to know from Setuptools itself at run time, what
filesystem path Setuptools installed the command to.

-- 
 \        “I took it easy today. I just pretty much layed around in my |
  `\        underwear all day. … Got kicked out of quite a few places, |
_o__)                              though.” —Bug-Eyed Earl, _Red Meat_ |
Ben Finney



More information about the Distutils-SIG mailing list