问题
Is it possible embed pictures into docstring in Python?
I saw docpicture
keyword somewhere, but can't find doc on it. Is it stabdartized or not?
Where does picture should located?
UPDATE
I tried Sphinx notation, but my PyCharm shows
i.e. it sees that it should be an image here, but doesn't see image file.
Where I would put if used Sphinx?
回答1:
That depends on what tool you use for processing your docstring. Check your tool's documentation to find out how to embed images.
For example, if you are using Sphinx, you can use the image
directive, as described in this StackOverflow answer:
.. image:: example.png
Regarding the location of the image, the documentation states:
When used within Sphinx, the file name given [...] must either be relative to the source file, or absolute which means that they are relative to the top source directory. For example, the file sketch/spam.rst could refer to the image images/spam.png as ../images/spam.png or /images/spam.png.
来源:https://stackoverflow.com/questions/45739474/is-it-possible-embed-pictures-into-docstring-in-python