On Sat, Oct 15, 2016 at 4:38 PM, Ben Finney <ben+pyt...@benfinney.id.au> wrote:
> Thomas Kluyver <tho...@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.

I won't claim it's pretty to look at, but if this is a major issue
then as a workaround I suppose you can consider adding a dependency on
https://pypi.org/project/setproctitle/ and running

[sys.executable, '-c', 'import setproctitle;
setproctitle.setproctitle("foo"); import foomod; foomod.main()]


Nathaniel J. Smith -- https://vorpus.org
Distutils-SIG maillist  -  Distutils-SIG@python.org

Reply via email to