Style Guide for Python Code

PEP 8 : https://www.python.org/dev/peps/pep-0008/

  • Use 4 spaces per indentation level.
  • Limit all lines to a maximum of 79 characters.
  • Surround top-level function and class definitions with two blank lines.
  • Code in the core Python distribution should always use UTF-8 (or ASCII in Python 2).
  • Imports should usually be on separate lines. Imports are always put at the top of the file, just after any module comments and docstrings
    Imports should be grouped in the following order:
    standard library imports
    related third party imports
    local application/library specific imports
    You should put a blank line between each group of imports.
  • Immediately inside parentheses, brackets or braces. Immediately before a comma, semicolon, or colon.
  • Class names should normally use the CapWords convention.
  • …..

Coding Style Check module : https://pypi.python.org/pypi/pep8