Friday, December 23, 2016

My Python Workflow

This is basically what I did whenever starting on new Python project.

mkdir project_name
cd project_name
wget https://bootstrap.pypa.io/bootstrap-buildout.py
vim buildout.cfg

Where my buildout.cfg look like:-

[buildout]
parts = main

[main]
recipe = zc.recipe.egg
eggs =
    python-telegram-bot

interpreter = python


Then I just execute the following to get my new python environment initialize:-

python bootstrap.py
./bin/buildout

A python interpreter that already has access to my packages dependencies - in this case python-telegram-bot is ready in ./bin/python.

I'm a fan of buildout and shall write more about it in later post.