PythonCodingStandards ssharad@outlook.com
Agenda
Who’sThisGuy?
AnotherOne...
LastOne.
Terminology-PEP - Python Enhancement Proposal - PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. The PEP should provide a concise technical specification of the feature and a rationale for the feature. - PEP 0001: https://www.python.org/dev/peps/pep-0001/
ThePhilosophy-CoreMantras Code is read much more often than it is written.
PythonStyleGuide - PEP-0008 - Coding conventions - https://www.python.org/dev/peps/pep-0008/ - PEP-0257 - Docstring conventions - https://www.python.org/dev/peps/pep-0257/
PEP8 - http://pep8.readthedocs.org/en/latest/intro.html - 72 error codes (as of Nov 27, 2015) - Samples:
PEP257 - http://pep257.readthedocs.org/en/latest/ - 24 error codes (as of Nov 27, 2015) - Samples:
QuickRe-Cap
TheHowPartOfIt-SomeHandyTools - pep8 - pep257 - pylint - autopep8
MoreOnSettingUpTools ● Pylint http://www.pylint.org/ http://docs.pylint.org/index.html ● pep8, pep257 sudo pip install pep8 sudo pip install pep257 pep8 --statistics <repository path> pep257 <repository path> ● IDEs ○ PyCharm ■ PyCharm: https://www.jetbrains. com/pycharm/ ■ Integrate Pylint in PyCharm: http: //softwaretester.info/integrate- pylint-in-pycharm/ ■ Running Pylint in PyCharm: http: //blog.saturnlaboratories.co. za/archive/2012/09/10/running- pylint-pycharm ■ Write Clean, Professional, Maintainable, Quality Code in Python: http://blog.jetbrains. com/pycharm/2014/06/write-clean- professional-maintainable-quality- code-in-python/
MoreOnSettingUpTools,Contd. ● IDEs ○ Sublime Text ■ Sublime Text: http://www.sublimetext.com/ ■ SublimeLinter: http://www.sublimelinter.com/en/latest/ ■ SublimeLinter plugin for python, using Pylint: https://github. com/SublimeLinter/SublimeLinter-pylint ■ Pylint in Sublime Text: http://stackoverflow.com/questions/16794613/pylint- in-sublime-text-2 ■ Install Anaconda: http://damnwidget.github.io/anaconda/ ■ Change Anaconda-settings(for 120 lines) - ■ Package Settings -> Anaconda -> User Settings – here add following entries -: ■ "pep8": true ■ "pep8_max_line_length": 120
MakeYourManager(s)Happy-ShowThemSomeGraphs
SomeMore...
AndDone!!!
ssharad@outlook.com

Python coding standards