Python Language Basic Concepts

  • Published: June 14, 2016
  • Style guide for python code PEP-8 https://www.python.org/dev/peps/pep-0008/

    • Tools to help in formatting Python code:
    • pep8 checks your Python code against some of the style conventions.
    • autopep8 automatically formats Python code to conform to the PEP 8 style guide.
  • Relative imports makes code more portable.

    • absolut import from core.views import absolute <— To import from outside the app
    • explicit relative from .models import CommandModel <— To import in current app
  • Avoid Using Import * as it can lead to undesirable results. You can’t really know which packages you are using.

Uruguay
Marcelo Canina
I'm Marcelo Canina, a developer from Uruguay. I build websites and web-based applications from the ground up and share what I learn here.
comments powered by Disqus
Except as otherwise noted, the content of this page is licensed under CC BY-NC-ND 4.0 ·