forked from lowks/pythonpy
-
Notifications
You must be signed in to change notification settings - Fork 0
More Examples
Russell91 edited this page Jun 14, 2014
·
53 revisions
Pythonpy will automatically replace sharp quotes with single quotes before processing an expression:
py '`hello world`' hello world py '"ma`am"' ma'am
Run a statement as you would using python -c with py -c:
py -c 'a = 5; print(`a`)' 5
Plot data you have access to from the command line using the pyplt alias:
alias pyplt='py -c '"'"'import matplotlib; matplotlib.use(`Agg`); import matplotlib.pyplot as plt'"'"' -C '"'"'plt.savefig("output.pdf")'"'"
py '[math.sin(x/10) for x in range(100)]' | pyplt -l 'plt.plot(l)'