Note: To use doctest-mode within python-mode, you must have mmm-mode installed, and enable doctest-mode's support for mmm-mode. See MMM-Mode Support for instructions. This walk-through assumes that mmm-mode support has already been enabled. Open or create a Python file whose docstrings have doctest examples. The example file to the right defines a single function, x-intercept(). |
def x_intercept(m, b): """ Return the x intercept of the line y=m*x+b. >>> x_intercept(3, 6) -2.0 >>> x_intercept(-4, 2) 0.5 """ return -float(b)/m . ISO8---Emacs: mytest.py (Python Font)----L11--All-------------- |