Knowledgebase

Getting Started: Everything That Matters, Briefly Print

  • python, guide, howto, solution, zillionkinghost, hosting, support
  • 0

The summary.

USE PYTHON 3

Python 2 is obsolete. Code written for it does not run without changes.

Choose a recent stable version, not the newest on release day — libraries lag behind.

CREATE A VIRTUAL ENVIRONMENT FOR EVERY PROJECT

Without exception. It isolates dependencies so projects do not break each other.

Never copy an environment between machines; recreate it from the requirements file.

RECORD AND PIN YOUR DEPENDENCIES

An unpinned dependency updates and changes behaviour without warning.

Check the package name carefully — deliberately misnamed packages exist to catch typing errors.

NEVER PLACE CREDENTIALS IN CODE

Read them from the environment or a configuration file excluded from version control.

RUN YOUR CODE FREQUENTLY

Small steps, each verified. Fifty lines written before the first run means you will not know which part failed.

READ TRACEBACKS FROM THE BOTTOM

The last line states what went wrong.

CONFIGURE YOUR EDITOR FOR SPACES, NOT TABS

Python uses indentation as syntax, and mixing the two causes errors that are hard to see.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot