summaryrefslogtreecommitdiffstats
path: root/software
diff options
context:
space:
mode:
authorbryan newbold <bnewbold@twinleaf.com>2014-06-20 00:44:12 -0400
committerbryan newbold <bnewbold@twinleaf.com>2014-06-20 00:44:12 -0400
commite9dbac33e457ad6ead3fc5f9a4e97dac38ddc96b (patch)
treead7b402b2b6d2b6c8c31d0301df2620aa79110e0 /software
parent55655aa8537f1d58ac0b34c994327b129e4f55d8 (diff)
downloadknowledge-e9dbac33e457ad6ead3fc5f9a4e97dac38ddc96b.tar.gz
knowledge-e9dbac33e457ad6ead3fc5f9a4e97dac38ddc96b.zip
python: runsnakerun and pep8
Diffstat (limited to 'software')
-rw-r--r--software/python.page18
1 files changed, 17 insertions, 1 deletions
diff --git a/software/python.page b/software/python.page
index 5d05ad8..9675873 100644
--- a/software/python.page
+++ b/software/python.page
@@ -14,7 +14,8 @@ Python PEP-008 <http://www.python.org/dev/peps/pep-0008/>: Style Guide for
Python Code
pylint <http://pypi.python.org/pypi/pylint>, a Python syntax checker. Very
-verbose, use pylint -E or at least pylint -r no.
+verbose, use pylint -E (errors only) or at least pylint -r no (no report). Eg,
+"pylint -r no file.py -d W0614 -d C -d R".
For docstring documentation, refer to
PEP-257<http://www.python.org/dev/peps/pep-0257/> and the Sphinx
@@ -56,6 +57,14 @@ of "Sphinx style". For example:
"""
return 0
+autopep8 is a tool to automatically pep8-ify a file:
+
+ sudo pip install autopep8
+ autopep8 --in-place --select=W293,W191,W291 *.py
+
+pep8radius is sort of similar, but only applies to code that you are going to
+commit (using VCS info).
+
Packaging
-----------
@@ -79,3 +88,10 @@ ASCII
----------------
'ord' is the function that takes a single ASCII character and returns the value
number (as an int).
+
+RunSnakeRun
+-------------
+
+$ python -m cProfile -o ./dump.profile myscript.py --script-option blah
+$ # run to completion or Ctrl-C, then
+$ runsnakerun ./dump.profile