Skip to content

Instantly share code, notes, and snippets.

@squirly
Created November 14, 2012 02:06
Show Gist options
  • Save squirly/4069822 to your computer and use it in GitHub Desktop.
Save squirly/4069822 to your computer and use it in GitHub Desktop.
Sailbot Presentation

Python

The language

PEP - Python Enhancement Proposals - http://python.org/dev/peps

Docs - Language syntax and the Standard Library - http://docs.python.org/2/

PyPi - For finding useful programs and libraries - http://pypi.python.org/

PEP8 - A document outlining the accepted python formatting standards.

Tools

iPython

An easy to use command line interpreter

pip

Useage:

pip install <package>        installs a package
pip uninstall <package>      removes a package
pip freeze                     save current state

pip is smart:

pip install <path_or_url>    install from file
pip install git+<git_repo>   install from git

virtualenv

Useage:

virtualenv venv                 Setup a new virtualenv
. venv/bin/activate             use this virtualenv
venv/bin/pip <command>          virtualenv's pip
venv/bin/python                 virtualenv's python
rm -r venv                      remove this venv

Aptana

A good IDE - http://www.aptana.com/

py.test

A pythonic testing framework - http://pytest.org/

Test Driven Development

Further into the Rabbit Hole

The Hitchhiker's Guide to Python

Python Konas

PEP 3103

Developing in Python

Python, an intro, and TTD

History

  • Creator - The BDFL
  • Qualities Inherited from other languages
  • Current versions

Why Python

  • Simple
  • "Batteries included"
  • Fast*

What makes it great (maybe)

REPL

  • Definition
  • From lisp
  • Python Implementation Example
  • Using REPL
  • iPython

Code Example

Spam & Eggs

Developing Python Projects

Your python, your environment

Tools

  • pip
  • virtualenv
  • IDE (Aptana)

Code Example

Starting your project


Testing

Ensuring your code works

Testing

  • What it is
  • Why we do it

py.test

  • pythonic
  • assert
  • options

Code Example

Testing your project


Test Driven Development

The art of testing

TDD

  • What it is
  • the steps
  • more ways of explaining above

Code Example

Using TDD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment