OpenNTI / sphinxcontrib-programoutput

Sphinx extension for capturing program output
BSD 3-Clause "New" or "Revised" License
37 stars 17 forks source link

How to specify a python interpreter? #42

Closed GuokLiu closed 4 years ago

GuokLiu commented 4 years ago

Sincerely thanks for your amazing tool.

Does programoutput use the default python interpreter?

How to specify a python interpreter?

Thank you very much : )

jamadden commented 4 years ago

The directives provided by this package execute any arbitrary command. The documentation just uses python as an example because it's commonly available. If you want to run any command, you just need to use a complete path to it as the argument to the directive, or arrange for it to be on the PATH.

.. Use a complete path
.. program-output:: /opt/local/bin/python3.8 -v

.. Assume this is on the PATH
.. program-output:: python3 —help

.. Not limited to Python, runs arbitrary commands
.. program-output:: /opt/local/bin/perl-5.30 -v
GuokLiu commented 4 years ago

Hi, Jamadden, Sorry, I missed checking my email and Github. Sincerely thanks for your timely reply.

I thought setting PATH should work for me, but failed. However, specifying an absolute path is ok.

BTW. I super like this extension.

Thank you very much : )