Convert a python script to markdown. Useful for presenting code to your co-workers.
sudo ln -s $PWD/py2md /usr/local/bin/
Lines starting with #
are considered to be markdown. Other lines are
considered to be source code.
py2md README.py > README.md
Import numpy and matplotlib.
import numpy as np
import pylab as plt
Plan
def my_sin(x):
'''This is a docstring'''
return np.sin(x)
x = np.linspace(0, 2 * np.pi, 100)
y = my_sin(x)
plt.plot(x, y)
plt.savefig('plot.png')