From e9dbac33e457ad6ead3fc5f9a4e97dac38ddc96b Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Fri, 20 Jun 2014 00:44:12 -0400 Subject: python: runsnakerun and pep8 --- software/python.page | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 : Style Guide for Python Code 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 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 -- cgit v1.2.3