Source code for python3_module_template.subproject2.myexample2
"""
This the documentation of this module (myexample2).
To make a reference to a blog post, just read :ref:`label-to-this-blogpost`.
The following documentation comes from a directive
`runpython
<http://www.xavierdupre.fr/app/pyquickhelper/helpsphinx/pyquickhelper/helpgen/sphinx_runpython_extension.html>`_
which outputs documentation on the standard output::
.. runpython::
:showcode:
for l in range(0,10):
print(" line", l)
Which gives:
.. runpython::
:showcode:
for l in range(0,10):
print(" line", l)
And without the input code:
.. runpython::
for l in range(0,10):
print(" line", l)
You can also add option *rst*::
.. runpython::
:rst:
for l in range(0,10):
print("**line**", "*" +str(l)+"*")
print('')
Which displays interpreted RST:
.. runpython::
:rst:
for l in range(0,10):
print("**line**", "*" +str(l)+"*")
print('')
It can be run in a separate process with option ``:process:``
(click on source):
.. runpython::
:process:
import python3_module_template
import os
print(os.path.split(python3_module_template.__file__)[-1])
:githublink:`%|py|61`
"""
from ..subproject.myexample import myclass
[docs]class myclass2(myclass):
"""
This is the documentation for this class.
.. list-table::
:widths: auto
:header-rows: 1
* - attribute
- meaning
* - pa
- an example of an attribute.
Inline :math:`x^2 + y + z`. Another equation to test:
.. math::
x^2 + y
.. math::
\\sum_{i=1}^n x^2
:githublink:`%|py|81`
"""
[docs] def __init__(self, pa):
"""
:param pa: first parameter
:githublink:`%|py|86`
"""
myclass.__init__(self, pa)
[docs] def get_value(self, mul):
"""
returns the parameter multiplied by a value
:param mul: a float
:return: a float
:githublink:`%|py|94`
"""
return self.pa * mul
[docs] @staticmethod
def static_example():
"""
:return: a boolean
:githublink:`%|py|101`
"""
return True
@property
def property_example(self):
"""
a property example
:githublink:`%|py|108`
"""
return True