🏷 python

Snippets, tricks and reference notes for Python, anaconda and related projects

Django

3 min read
Activate an environmentPre-install django in this env conda create -n tutorial django=1.8 activate tutorial mkdir tutorial cd tutorial Create requirements.txtAnd install via pip (if needed): touch requirements.txt django==1.8 > requirements.txt pip install…▷ read more

Python

5 min read
Quick start #!/usr/bin/env python print "Hello World" Listsa = [1,2,3,4,5,6] a[0:1] # first element a[2:4] # slice mid elements, second parameter is exclusive a[2:] # all elements after third element Is an element included in a listCheck if element is containe…▷ read more

60 seconds to TDD

1 min read
This quick tutorial presents a minimal setup with Python to start coding using TDD. It only requires two lightweight dependencies nose and when-changed available through pip . Install and run sudo pip install nose sudo pip install when-changed The following…▷ read more