This commit is contained in:
Kenneth Reitz
2012-09-02 04:44:37 -04:00
parent 038d7cf4f8
commit e8b246f53d
104 changed files with 131 additions and 9005 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f9ca5d98ba72140a2e4abd39df74c871
config: 482b79009dc7bb9dba1ccab6f9c586c2
tags: fbb0d17656682115ca4d033fb2f83ba1
-241
View File
@@ -1,241 +0,0 @@
Your Development Environment
============================
Text Editors
::::::::::::
Just about anything which can edit plain text will work for writing Python code,
however, using a more powerful editor may make your life a bit easier.
VIM
---
There exist a couple of plugins and settings for the VIM editor to aid python
development. If you only develop in Python, a good start is to set the default
settings for indentation and linewrapping to values compliant with PEP8::
set textwidth=79
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround
With these settings newlines are inserted after 79 characters and indentation
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
handy plugin at indent_, which handles indentation settings for python source
files.
Additionally there is also a handy syntax plugin at syntax_ featuring some
improvements over the syntax file included in VIM 6.1.
These plugins supply you with a basic environment for developing in Python.
However in order to improve the programming flow we also want to continually
check for PEP8 compliance and check syntax. Luckily there exist PEP8_ and
Pyflakes_ to do this for you. If your VIM is compiled with `+python` you can
also utilize some very handy plugins to do these checks from within the editor.
For PEP8 checking install vim-pep8_. Now you can map the vim function
`Pep8()` to any hotkey or action you want. Similarly for pyflakes you can
install vim-pyflakes_. Now you can map `Pyflakes()` like the PEP8 function and
have it called quickly. Both plugins will display errors in a quickfix list and
provide an easy way to jump to the corresponding line. A very handy setting is
calling these functions whenever a buffer is saved. In order to do this, enter
the following lines into your vimrc::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
.. _indent: http://www.vim.org/scripts/script.php?script_id=974
.. _syntax: http://www.vim.org/scripts/script.php?script_id=790
.. _Pyflakes: http://pypi.python.org/pypi/pyflakes/
.. _vim-pyflakes: https://github.com/nvie/vim-pyflakes
.. _PEP8: http://pypi.python.org/pypi/pep8/
.. _vim-pep8: https://github.com/nvie/vim-pep8
.. todo:: add supertab notes
TextMate
--------
"`TextMate <http://macromates.com/>`_ brings Apple's approach to operating systems into the world of text editors. By bridging UNIX underpinnings and GUI, TextMate cherry-picks the best of both worlds to the benefit of expert scripters and novice users alike."
Sublime Text
------------
"`Sublime Text <http://www.sublimetext.com/>`_ is a sophisticated text editor
for code, html and prose. You'll love the slick user interface and
extraordinary features."
Sublime Text has excellent support for editing Python code and uses Python for
its plugin API.
`Sublime Text 2 <http://www.sublimetext.com/blog/articles/sublime-text-2-beta>`_ is currently in beta.
IDEs
::::
PyCharm / IntelliJ IDEA
-----------------------
`PyCharm <http://www.jetbrains.com/pycharm/>`_ is developed by JetBrains, also known for IntelliJ IDEA. Both share the same code base and most of PyCharm's features can be brought to IntelliJ with the free `Python Plug-In <http://plugins.intellij.net/plugin/?id=631/>`_.
Eclipse
-------
The most popular Eclipse plugin for Python development is Aptana's
`PyDev <http://pydev.org>`_.
Komodo IDE
-----------
`Komodo IDE <http://www.activestate.com/komodo-ide>`_ is developed by ActiveState and is a commerical IDE for Windows, Mac
and Linux.
Spyder
------
`Spyder <http://code.google.com/p/spyderlib/>`_ an IDE specifically geared toward working with scientific python libraries (namely `Scipy <http://www.scipy.org/>`_).
Includes integration with pyflakes_, `pylint <http://www.logilab.org/857>`_,
and `rope <http://rope.sourceforge.net/>`_.
Spyder is open-source (free), offers code completion, syntax highlighting, class and function browser, and object inspection.
Interpreter Tools
:::::::::::::::::
virtualenv
----------
Virtualenv is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x" dilemma and keeps your global site-packages directory clean and manageable.
`virtualenv <http://www.virtualenv.org/en/latest/index.html>`_ creates
a folder which contains all the necessary executables to contain the
packages that a Python project would need. An example workflow is given.
Install virtualenv::
$ pip install virtualenv
Create a virtual environment for a project::
$ cd my_project
$ virtualenv venv
``virtualenv venv`` will create a folder in the currect directory
which will contain the Python executable files, and a copy of the ``pip``
library which you can use to install other packages. The name of the
virtual environment (in this case, it was ``venv``) can be anything;
omitting the name will place the files in the current directory instead.
In order the start using the virtual environment, run::
$ source venv/bin/activate
The name of the current virtual environment will now appear on the left
of the prompt (e.g. ``(venv)Your-Computer:your_project UserName$``) to
let you know that it's active. From now on, any package that you install
using ``pip`` will be placed in the venv folder, isolated from the global
Python installation. Install packages as usual::
$ pip install requests
To stop using an environment simply type ``deactivate``. To remove the
environment, just remove the directory it was installed into. (In this
case, it would be ``rm -rf venv``).
Other Notes
~~~~~~~~~~~
Running ``virtualenv`` with the option ``--no-site-packages`` will not
include the packages that are installed globally. This can be useful
for keeping the package list clean in case it needs to be accessed later.
In order to keep your environment consistent, it's a good idea to "freeze"
the current state of the environment packages. To do this, run
::
$ pip freeze > requirements.txt
This will create a ``requirements.txt`` file, which contains a simple
list of all the packages in the current environment, and their respective
versions. Later, when a different developer (or you, if you need to re-
create the environment) can install the same packages, with the same
versions by running
::
$ pip install -r requirements.txt
This can help ensure consistency across installations, across deployments,
and across developers.
Lastly, remember to exclude the virtual environment folder from source
control by adding it to the ignore list.
virtualenvwrapper
-----------------
`Virtualenvwrapper <http://pypi.python.org/pypi/virtualenvwrapper>`_ makes virtualenv a pleasure to use by wrapping the command line API with a nicer CLI.
::
$ pip install virtualenvwrapper
Put this into your `~/.bash_profile` (Linux/Mac) file:
::
$ export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
This will prevent your virtualenvs from relying on your (global) site packages directory, so that they are completely separate..
Other Tools
:::::::::::
IPython
-------
`IPython <http://ipython.org/>`_ provides a rich toolkit to help you make the most out of using Python interactively. Its main components are:
* Powerful Python shells (terminal- and Qt-based).
* A web-based notebook with the same core features but support for rich media, text, code, mathematical expressions and inline plots.
* Support for interactive data visualization and use of GUI toolkits.
* Flexible, embeddable interpreters to load into your own projects.
* Tools for high level and interactive parallel computing.
::
$ pip install ipython
BPython
-------
`bpython <http://bpython-interpreter.org/>`_ is an alternative interface to the Python interpreter for Unix-like operating systems. It has the following features:
* In-line syntax highlighting.
* Readline-like autocomplete with suggestions displayed as you type.
* Expected parameter list for any Python function.
* "Rewind" function to pop the last line of code from memory and re-evaluate.
* Send entered code off to a pastebin.
* Save entered code to a file.
* Auto-indentation.
* Python 3 support.
::
$ pip install bpython
-128
View File
@@ -1,128 +0,0 @@
Virtual Environments
====================
A Virtual Environment, put simply, is an isolated working copy of Python which
allows you to work on a specific project without worry of affecting other
projects.
For example, you can work on a project which requires Django 1.3 while also
maintaining a project which requires Django 1.0.
virtualenv
----------
`virtualenv <http://pypi.python.org/pypi/virtualenv>`_ is a tool to create
isolated Python environments.
Install it via pip:
.. code-block:: console
$ pip install virtualenv
Basic Usage
~~~~~~~~~~~
1. Create a virtual environment:
.. code-block:: console
$ virtualenv venv
This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named ``venv``.
2. To begin using the virtual environment, it needs to be activated:
.. code-block:: console
$ source venv/bin/activate
You can then begin installing any new modules without affecting the system
default Python or other virtual environments.
3. If you are done working in the virtual environment for the moment, you can
deactivate it:
.. code-block:: console
$ deactivate
This puts you back to the system's default Python interpreter with all its
installed libraries.
To delete a virtual environment, just delete its folder.
After a while, though, you might end up with a lot of virtual environments
littered across your system, and its possible you'll forget their names or
where they were placed.
virtualenvwrapper
-----------------
`virtualenvwrapper <http://www.doughellmann.com/projects/virtualenvwrapper/>`_
provides a set of commands which makes working with virtual environments much
more pleasant. It also places all your virtual environments in one place.
To install (make sure **virtualenv** is already installed):
.. code-block:: console
$ pip install virtualenvwrapper
$ export WORKON_HOME=~/Envs
$ source /usr/local/bin/virtualenvwrapper.sh
(`Full virtualenvwrapper install instructions <http://www.doughellmann.com/docs/virtualenvwrapper/#introduction>`_.)
Basic Usage
~~~~~~~~~~~
1. Create a virtual environment:
.. code-block:: console
$ mkvirtualenv venv
This creates the ``venv`` folder inside ``~/Envs``.
2. Work on a virtual environment:
.. code-block:: console
$ workon venv
**virtualenvwrapper** provides tab-completion on environment names. It really
helps when you have a lot of environments and have trouble remembering their
names.
``workon`` also deactivates whatever environment you are currently in, so you
can quickly switch between environments.
3. Deactivating is still the same:
.. code-block:: console
$ deactivate
4. To delete:
.. code-block:: console
$ rmvirtualenv venv
Other useful commands
~~~~~~~~~~~~~~~~~~~~~
``lsvirtualenv``
List all of the environments.
``cdvirtualenv``
Navigate into the directory of the currently activated virtual environment,
so you can browse its ``site-packages``, for example.
``cdsitepackages``
Like the above, but directly into ``site-packages`` directory.
``lssitepackages``
Shows contents of ``site-packages`` directory.
`Full list of virtualenvwrapper commands <http://www.doughellmann.com/docs/virtualenvwrapper/command_ref.html#managing-environments>`_.
+8 -10
View File
@@ -1,15 +1,13 @@
.. osxpython documentation master file, created by
sphinx-quickstart on Wed Aug 4 22:51:11 2010.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
The Conduct of Code
===================
The Hitchhiker's Guide to Python!
=================================
Welcome to The Hitchhiker's Guide to Python. `DON'T PANIC! <http://www.amazon.com/gp/product/B0043M4ZH0/ref=as_li_ss_tl?ie=UTF8&tag=bookforkind-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=B0043M4ZH0>`_
Welcome to The Hitchhiker's Guide to Python. **DON'T PANIC!**
**This guide is currently under heavy development, and is mostly a skeleton at
the moment.** If you'd like to help, `fork us on GitHub <https://github.com/kennethreitz/python-guide>`_!
**This guide is currently under heavy development, and is mostly a skeleton at the moment.** If you'd like to help, `fork us on GitHub <https://github.com/kennethreitz/python-guide>`_!
This *opinionated* guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
This *opinionated* guide exists to provide both novice and expert Python
developers a best-practice handbook to the installation, configuration, and
usage of Python on a daily basis.
.. include:: contents.rst.inc
-73
View File
@@ -1,73 +0,0 @@
The Community
=============
BDFL
----
Guido van Rossum, the creator of Python, is often referred to as the BDFL — the Benevolent Dictator For Life.
Python Software Foundation
--------------------------
The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.
`Learn More about the PSF <http://www.python.org/psf/>`_.
PEPs
----
PEPs are *Python Enhancement Proposals*. They describe changes to Python itself, or the standards around it.
There are three different types of PEPs (as defined by `PEP1 <http://www.python.org/dev/peps/pep-0001/>`_):
**Standards**
Describes a new feature or implementation.
**Informational**
Describes a design issue, general guidelines, or information to the community.
**Process**
Describes a process related to Python.
Notable PEPs
~~~~~~~~~~~~
There are a few PEPs that could be considered required reading:
- `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_: The Python Style Guide.
Read this. All of it. Follow it.
- `PEP20 <http://www.python.org/dev/peps/pep-0020/>`_: The Zen of Python.
A list of 19 statements that briefly explain the philosophy behind Python.
- `PEP257 <http://www.python.org/dev/peps/pep-0257/>`_: Docstring Conventions.
Gives guidelines for semantics and conventions associated with Python docstrings.
You can read more at `The PEP Index <http://www.python.org/dev/peps/>`_.
Submitting a PEP
~~~~~~~~~~~~~~~~
PEPs are peer-reviewed and accepted/rejected after much discussion. Anyone can write and submit a PEP for review.
Here's an overview of the PEP acceptance workflow:
.. image:: http://www.python.org/dev/peps/pep-0001/pep-0001-1.png
Python Conferences
--------------------------
The major events for the Python community are developer conferences. The two most notable conferences are PyCon, which is held in the US, and its European sibling, EuroPython.
A comprehensive list of conferences is maintained `at pycon.org <http://www.pycon.org/>`_.
Python User Groups
--------------------------
User Groups are where a bunch of Python developers meet to present or talk about Python topics of interest. A list of local user groups is maintained at the `Python Software Foundation Wiki <http://wiki.python.org/moin/LocalUserGroups>`_.
-20
View File
@@ -1,20 +0,0 @@
Documentation
=============
Official Documentation
----------------------
The official Python Language and Library documentation can be found here:
- `Python 2.x <http://docs.python.org/>`_
- `Python 3.x <http://docs.python.org/py3k/>`_
Read the Docs
-------------
Read the Docs is a popular community project, providing a single location for all documentation of popular and even more exotic Python modules.
`Read the Docs <http://readthedocs.org/>`_
-39
View File
@@ -1,39 +0,0 @@
Introduction
============
.. todo:: write a general blurb introducing the Python language
.. _about-ref:
About This Guide
----------------
Purpose
~~~~~~~
The Hitchhiker's Guide to Python exists to provide both novice and expert
Python developers a best-practice handbook to the installation, configuration,
and usage of Python on a daily basis.
By the Community
~~~~~~~~~~~~~~~~
This guide is architected and maintained by `Kenneth Reitz
<https://github.com/kennethreitz>`_ in an open fashion. This is a
community-driven effort that serves one purpose: to serve the community.
For the Community
~~~~~~~~~~~~~~~~~
All contributions to the Guide are welcome, from Pythonistas of all levels.
If you think there's a gap in what the Guide covers, fork the Guide on
GitHub and submit a pull request. Contributions are welcome from everyone,
whether they're an old hand or a first-time Pythonista, and the authors to
the Guide will gladly help if you have any questions about the
appropriateness, completeness, or accuracy of a contribution.
To get started working on The Hitchhiker's Guide, see
the :doc:`/notes/contribute` page.
-67
View File
@@ -1,67 +0,0 @@
Learning Python
===============
Beginner
--------
Learn Python Interactive Tutorial
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Learnpython.org is an easy non-intimidating way to get introduced to python. The website takes the same approach used on the popular `Try Ruby <http://tryruby.org/>`_ website, it has an interactive python interpreter built into the site that allows you to go through the lessons without having to install Python locally.
`Learn Python <http://www.learnpython.org/>`_
Learn Python the Hard Way
~~~~~~~~~~~~~~~~~~~~~~~~~
This is an excellent beginner programmer's guide to Python. It covers "hello world" from the console to the web.
`Learn Python the Hard Way <http://learnpythonthehardway.org/book/>`_
Crash into Python
~~~~~~~~~~~~~~~~~
Also known as *Python for Programmers with 3 Hours*, this guide gives experienced developers from other languages a crash course on Python.
`Crash into Python <http://stephensugden.com/crash_into_python/>`_
Dive Into Python 3
~~~~~~~~~~~~~~~~~~
Dive Into Python 3 is a good book for those ready to jump in to Python 3. It's a
good read if you are moving from Python 2 to 3 or if you already have some
experience programming in another language.
`Dive Into Python 3 <http://diveintopython3.ep.io/>`_
Think Python: How to Think Like a Computer Scientist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Think Python attempts to give an introduction to basic concepts in computer science through the
use of the python language. The focus was to create a book with plenty of exercises, minimal jargon and
a section in each chapter devoted to the subject of debugging.
While exploring the various features available in the python language the author weaves in various design
patterns and best practices.
The book also includes several case studies which have the reader explore the topics discussed in the book
in greater detail by applying those topics to real-world examples. Case studies include assignments in GUI
and Markov Analysis.
`Think Python <http://greenteapress.com/thinkpython/html/index.html>`_
Advanced
--------
Pro Python
~~~~~~~~~~
.. todo:: Write about `Pro Python <http://propython.com/>`_
Expert Python Programming
~~~~~~~~~~~~~~~~~~~~~~~~~
.. todo:: Write about `Expert Python Programming <http://www.packtpub.com/expert-python-programming/book>`_
-25
View File
@@ -1,25 +0,0 @@
News
====
Planet Python
~~~~~~~~~~~~~
This is an aggregate of Python news from a growing number of developers.
`Planet Python <http://planet.python.org>`_
/r/python
~~~~~~~~~
/r/python is the Reddit Python community where users contribute and vote on
Python-related news.
`/r/python <http://reddit.com/r/python>`_
Python Weekly
~~~~~~~~~~~~~
Python Weekly is a free weekly newsletter featuring curated news, articles,
new releases, jobs, etc. related to Python.
`Python Weekly <http://www.pythonweekly.com/>`_
-27
View File
@@ -1,27 +0,0 @@
Contribute
~~~~~~~~~~
Python-guide is under active development, and contributors are welcome.
If you have a feature request, suggestion, or bug report, please open a new
issue on GitHub_. To submit patches, please send a pull request on GitHub_.
Once your changes get merged back in, you'll automatically be added to the
`Contributors List <https://github.com/kennethreitz/python-guide/contributors>`_.
Style Guide
-----------
For all contributions, please follow the :ref:`guide-style-guide`.
.. _todo-list-ref:
Todo List
---------
If you'd like to contribute, there's plenty to do. Here's a short todo_ list.
.. include:: ../../TODO.rst
.. _GitHub: http://github.com/kennethreitz/python-guide/
.. _todo: https://github.com/kennethreitz/python-guide/blob/master/TODO.rst
-4
View File
@@ -1,4 +0,0 @@
License
-------
.. todo:: Determine License
-164
View File
@@ -1,164 +0,0 @@
.. _guide-style-guide:
=====================
The Guide Style Guide
=====================
As with all documentation, having a consistent formating helps make the
document more understandable. In order to make The Guide easier to digest,
all contributions should fit within the rules of this style guide where
approriate.
The Guide is written as :ref:`restructuredtext-ref`.
.. note:: Parts of The Guide may not yet match this style guide. Feel free
to update those parts to by in sync with The Guide Style Guide
.. note:: On any page of the rendered HTML you can click "Show Source" to
see how authors have styled the page.
Relevancy
---------
Stride to keep any contributions relevant to the :ref:`purpose of The Guide
<about-ref>`.
* Avoid including too much information on subjects that don't directly
relate to Python development.
* Prefer to link to other sources if the information is already out there.
Be sure to describe what and why you are linking.
* `Cite <http://sphinx.pocoo.org/rest.html?highlight=citations#citations>`_
references where needed.
* If a subject isn't directly relevant to Python, but useful in conjuction
with Python (ex: Git, Github, Databases), reference by linking to useful
resouces and describe why it's useful to Python.
* When in doubt, ask.
Headings
--------
Use the following styles for headings.
Chapter title::
#########
Chapter 1
#########
Page title::
===================
Time is an Illusion
===================
Section headings::
Lunchtime Doubly So
-------------------
Sub section headings::
Very Deep
~~~~~~~~~
Prose
-----
Wrap text lines at 78 characters. Where necessary, lines may exceed 78
characters, especially if wrapping would make the source text more difficult
to read.
Code Examples
-------------
Wrap all code examples at 70 characters to avoid horizontal scrollbars.
Command line examples::
.. code-block:: console
$ run command --help
$ ls ..
Be sure to include the ``$`` prefix before each line.
Python interpreter examples::
Label the example::
.. code-block:: python
>>> import this
Python examples::
Descriptive title::
.. code-block:: python
def get_answer():
return 42
Externally Linking
------------------
* Prefer labels for well known subjects (ex: proper nouns) when linking::
Sphinx_ is used to document Python.
.. _Sphinx: http://sphinx.pocoo.org
* Prefer to use descriptive labels with inline links instead of leaving bare
links::
Read the `Sphinx Tutorial <http://sphinx.pocoo.org/tutorial.html>`_
* Avoid using labels such as "click here", "this", etc. preferring
decriptive labels (SEO worthy) instead.
Linking to Sections in The Guide
--------------------------------
To cross-reference other parts of this documentation, use the `:ref:
<http://sphinx.pocoo.org/markup/inline.html#cross-referencing-arbitrary-locations>`_
keyword and labels.
To make reference labels more clear and unique, always add a ``-ref`` suffix::
.. _some-section-ref:
Some Section
------------
Notes and Warnings
------------------
Make use of the appropriate `admonitions directives
<http://sphinx.pocoo.org/rest.html#directives>`_ when making notes.
Notes::
.. note::
The Hitchhikers Guide to the Galaxy has a few things to say
on the subject of towels. A towel, it says, is about the most
massively useful thing an interstellar hitch hiker can have.
Warnings::
.. warning:: DON'T PANIC
TODOs
-----
Please mark any incomplete areas of The Guide with a `todo directive
<http://sphinx.pocoo.org/ext/todo.html?highlight=todo#directive-todo>`_. To
avoid cluttering the :ref:`todo-list-ref`, use a single ``todo`` for stub
documents or large incomplete sections.
::
.. todo::
Learn the Ultimate Answer to the Ultimate Question
of Life, The Universe, and Everything
-87
View File
@@ -1,87 +0,0 @@
Systems Administration
======================
Fabric
------
Fabric is a library for simplifying system administration tasks. While Chef
and Puppet tend to focus on managing servers and system libraries,
fabric is more focused on application level tasks such as deployment.
Install Fabric:
.. code-block:: bash
$ pip install fabric
The following code will create two tasks that we can use: ``memory_usage`` and
``deploy``. The former will output the memory usage on each machine. The
latter will ssh into each server, cd to our project directory, activate the
virtual environment, pull the newest codebase, and restart the application
server.
::
from fabric.api import cd, env, prefix, run, task
env.hosts = ['my_server1', 'my_server2']
@task
def memory_usage():
run('free -m')
@task
def deploy():
with cd('/var/www/project-env/project'):
with prefix('. ../bin/activate'):
run('git pull')
run('touch app.wsgi')
With the previous code saved in a file named fabfile.py, we can check memory
usage with:
.. code-block:: bash
$ fab memory_usage
[my_server1] Executing task 'memory'
[my_server1] run: free -m
[my_server1] out: total used free shared buffers cached
[my_server1] out: Mem: 6964 1897 5067 0 166 222
[my_server1] out: -/+ buffers/cache: 1509 5455
[my_server1] out: Swap: 0 0 0
[my_server2] Executing task 'memory'
[my_server2] run: free -m
[my_server2] out: total used free shared buffers cached
[my_server2] out: Mem: 1666 902 764 0 180 572
[my_server2] out: -/+ buffers/cache: 148 1517
[my_server2] out: Swap: 895 1 894
and we can deploy with:
.. code-block:: bash
$ fab deploy
Additional features include parallel execution, interaction with remote
programs, and host grouping.
Chef
----
.. todo:: Write about Chef
Puppet
------
.. todo:: Write about Puppet
Blueprint
---------
.. todo:: Write about Blueprint
Buildout
--------
.. todo:: Write about Buildout
-37
View File
@@ -1,37 +0,0 @@
Continuous Integration
======================
Why?
----
Martin Fowler, who first wrote about `Continuous Integration <http://martinfowler.com/articles/continuousIntegration.html>`_ (short: CI) together with Kent Beck, describes the CI as follows:
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.
Jenkins
-------
`Jenkins CI <http://jenkins-ci.org>`_ is an extensible continuous integration engine. Use it.
Buildbot
--------
`Buildbot <http://buildbot.net/buildbot/docs/current>`_ is a Python system to automate the compile/test cycle to validate code changes.
Mule?
-----
.. todo:: Write about Mule
Tox
---
`tox <https://bitbucket.org/hpk42/tox>`_ is an automation tool providing packaging, testing and deployment of Python software right from the console or CI server.
It is a generic virtualenv management and test command line tool which provides the following features:
* Checking that packages install correctly with different Python versions and interpreters
* Running tests in each of the environments, configuring your test tool of choice
* Acting as a frontend to Continuous Integration servers, reducing boilerplate and merging CI and shell-based testing.
-9
View File
@@ -1,9 +0,0 @@
Command Line Applications
=========================
.. todo:: Explain "Command Line Applications"
Clint
-----
.. todo:: Write about Clint
-28
View File
@@ -1,28 +0,0 @@
Databases
=========
DB-API
------
The Python Database API (DB-API) defines a standard interface for Python
database access modules. It's documented in `PEP 249 <http://www.python.org/dev/peps/pep-0249/>`_.
Nearly all Python database modules such as `sqlite3`, `psycopg` and
`mysql-python` conform to this interface.
SQLAlchemy
----------
`SQLAlchemy <http://www.sqlalchemy.org/>`_ is a commonly used database toolkit. Unlike many database libraries
it not only provides an ORM layer but also a generalized API for writing
database-agnostic code without SQL.
::
pip install sqlalchemy
Django ORM
----------
.. todo:: Explain Django ORM
-55
View File
@@ -1,55 +0,0 @@
GUI Applications
================
Qt
::
Qt is a cross-platform application framework that is widely used for developing software with a GUI but can also be used for non-GUI applications.
PySide
------
http://developer.qt.nokia.com/wiki/PySideDownloads/
PyQt
----
.. note:: If your software does not fully comply with the GPL you will need a commercial license!
http://www.riverbankcomputing.co.uk/software/pyqt/download
Cocoa
:::::
.. note:: The Cocoa framework is only available on Mac OSX. Don't pick this if you're writing a cross-platform application!
PyObjC
------
.. note:: Only available on Mac OSX. Don't pick this if you're writing a cross-platform application.
WXPython
::::::::
Install (Stable)
----------------
*Go to http://www.wxpython.org/download.php#stable and download the appropriate package for your OS.*
Gtk
:::
PyGTK provides Python bindings for the GTK+ toolkit. Like the GTK+ library
itself, it is currently licensed under the GNU LGPL. It is worth noting that
PyGTK only currenty supports the Gtk-2.X API (NOT Gtk-3.0). It is currently
recommended that PyGTK is not used for new projects and existing applications be
ported from PyGTK to PyGObject.
Tk
::
Tkinter is a thin object-oriented layer on top of Tcl/Tk. It has the advantage
of being included with the Python standard library, making it the most
convenient and compatible toolkit to program with.
Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
feel on all platforms.
There's a good multi-language Tk tutorial with Python examples at
`TkDocs <http://www.tkdocs.com/tutorial/index.html>`_. There's more information
available on the `Python Wiki <http://wiki.python.org/moin/TkInter>`_.
-50
View File
@@ -1,50 +0,0 @@
=======================
Scientific Applications
=======================
Context
:::::::
Python is frequently used for high-performance scientific applications. Python is widely used in academia
and scientific projects because it is easy to write, and it performs really well.
Due to its high performance nature, scientific computing in python often refers to external libraries, typically
written in faster languages (like C, or FORTRAN for matrix operations). The main libraries used are NumPy and SciPy
Libraries
:::::::::
Numpy
-----
`NumPy <http://numpy.scipy.org/>`_ is a low level library written in C (and FORTRAN) for high level mathematical functions.
NumPy cleverly overcomes the problem of running slower algorithms on Python by using multidimensional arrays and functions that operate on arrays.
Any algorithm can then be expressed as a function on arrays, allowing the algorithms to be run quickly.
NumPy is part of the SciPy project, and is released as a separate library so people who only need the basic requirements can just use NumPy.
NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+.
SciPy
-----
`SciPy <http://scipy.org/>`_ is a library that uses Numpy for more mathematical function. SciPy uses NumPy arrays as its basic data structure.
SciPy comes with modules for various commonly used tasks in scientific programing like linear algebra, integration (calculus),
ordinary differential equation solvers and signal processing.
Enthought
---------
Installing NumPy and SciPy can be a daunting task. Which is why the `Enthought Python distribution <http://enthought.com/>`_ was created. With Enthought,
scientific python has never been easier (one click to install about 100 scientific python packages). User beware: Enthought is not free.
Matplotlib
----------
.. todo:: write about matplotlib.
Resources
:::::::::
Many people who do scientific computing are on Windows. And yet many of the scientific computing packages are notoriously difficult to build and install.
`Christoph Gohlke <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_ however, has compiled a list of Windows binaries for many useful Python packages.
The list of packages has grown from a mainly scientific python resource to a more general list. It might be a good idea to check it out if you're on Windows.
-96
View File
@@ -1,96 +0,0 @@
Speed
=====
CPython, the most commonly used implementation of Python, is slow for CPU bound tasks. `PyPy`_ is fast.
Using a slightly modified version of `David Beazleys`_ CPU bound test code(added loop for multiple tests), you can see the difference between CPython and PyPy's processing.
::
PyPy
$ ./pypy -V
Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:10)
[PyPy 1.7.0 with GCC 4.4.3]
$ ./pypy measure2.py
0.0683999061584
0.0483210086823
0.0388588905334
0.0440690517426
0.0695300102234
::
CPython
$ ./python -V
Python 2.7.1
$ ./python measure2.py
1.06774401665
1.45412397385
1.51485204697
1.54693889618
1.60109114647
Context
:::::::
The GIL
-------
`The GIL`_ (Global Interpreter Lock) is how Python allows multiple threads to operate at the same time. Python's
memory management isn't entirely thread-safe, so the GIL is requried to prevents multiple threads from running
the same Python code at once.
David Beazley has a great `guide`_ on how the GIL operates. He also covers the `new GIL`_ in Python 3.2. His
results show that maximizing performance in a Python application requires a strong understanding of the GIL,
how it affects your specific application, how many cores you have, and where your application bottlenecks are.
C Extentions
------------
The GIL
-------
`Special care`_ must be taken when writing C extensions to make sure you register your threads
with the interpreter.
C Extentions
::::::::::::
Cython
------
Pyrex
-----
Shedskin?
---------
Threading
:::::::::
Threading
---------
Spanwing Processes
------------------
Multiprocessing
---------------
.. _`PyPy`: http://pypy.org
.. _`The GIL`: http://wiki.python.org/moin/GlobalInterpreterLock
.. _`guide`: http://www.dabeaz.com/python/UnderstandingGIL.pdf
.. _`New GIL`: http://www.dabeaz.com/python/NewGIL.pdf
.. _`Special care`: http://docs.python.org/c-api/init.html#threads
.. _`David Beazleys`: http://www.dabeaz.com/GIL/gilvis/measure2.py
-228
View File
@@ -1,228 +0,0 @@
================
Web Applications
================
Context
:::::::
WSGI
----
The Web Server Gateway Interface (or "WSGI" for short) is a standard
interface between web servers and Python web application frameworks. By
standardizing behavior and communication between web servers and Python web
frameworks, WSGI makes it possible to write portable Python web code that
can be deployed in any :ref:`WSGI-compliant web server <wsgi-servers-ref>`. WSGI is
documented in `PEP-3333 <http://www.python.org/dev/peps/pep-3333/>`_.
Frameworks
::::::::::
Broadly speaking, a web framework is a set of libraries upon which you can
build custom code to implement a web application (i.e. an interactive web
site). Most web frameworks include patterns and utilities to accomplish at
least the following:
URL Routing
Matches an incoming HTTP request to a particular piece of Python code to
be invoked
Request and Response Objects
Encapsulate the information received from or sent to a user's browser
Template Engine
Allows for separating Python code implementing an application's logic from
the HTML (or other) output that it produces
Development Web Server
Runs an HTTP server on development machines to enable rapid development;
often automatically reloads server-side code when files are updated
Django
------
`Django <http://www.djangoproject.com>`_ is a "batteries included" web
application framework. By providing many utilities and patterns out of the
box, Django aims to make it possible to build complex, database-backed web
applications quickly, while encouraging best practices in code written using
it.
Django has a large and active community, and many pre-built `re-usable
modules <http://djangopackages.com/>`_ that can be incorporated into a new
project as-is, or customized to fit your needs.
There are annual Django conferences `in the United States
<http://djangocon.us>`_ and `in Europe <http://djangocon.eu>`_.
Flask
-----
`Flask <http://flask.pocoo.org/>`_ is a "microframework" for Python. Rather
than aiming to provide everything you could possibly need, Flask implements
the most commonly-used core components of a web application framework, like
URL routing, request and response objects, and templates. As a user of
Flask, it is therefore up to you to choose and integrate other components
you may need, such as database access or form generation and validation. For
many popular modules, `Extensions <http://flask.pocoo.org/extensions/>`_ may
already exist to suit your needs.
**Support** for flask can best be found in its mailing list. Just shoot an email to
flask@librelist.com and reply to the confirmation email.
.. todo:: Explain Pyramid
Web Servers
:::::::::::
.. _nginx-ref:
Nginx
-----
`Nginx <http://nginx.org/>`_ (pronounced "engine-x") is a web server and
reverse-proxy for HTTP, SMTP and other protocols. It is known for its
high performance, relative simplicity, and compatibility with many
application servers (like WSGI servers). It also includes handy features
like load-balancing, basic authentication, streaming, and others. Designed
to serve high-load websites, Nginx is gradually becoming quite popular.
.. _wsgi-servers-ref:
WSGI Servers
::::::::::::
Stand-alone WSGI servers typically use less resources than traditional web
servers and provide top performance [3]_.
.. _gunicorn-ref:
Gunicorn
--------
`Gunicorn <http://gunicorn.org/>`_ (Green Unicorn) is a WSGI server used
to serve Python applications. It is a Python interpretation of the Ruby
`Unicorn <http://unicorn.bogomips.org/>`_ server. Unicorn is designed to be
lightweight, easy to use, and uses many UNIX idioms. Gunicorn is not designed
to face the internet, in fact it was designed to run behind Nginx which buffers
slow requests, and takes care of other important considerations. A sample
setup for Nginx + gUnicorn can be found in the
`Gunicorn help <http://gunicorn.org/deploy.html>`_.
.. _uwsgi-ref:
Server Best Practices
:::::::::::::::::::::
The majority of self hosted Python applications today are hosted with a WSGI
server such as :ref:`gUnicorn <gunicorn-ref>`, either directly or behind a
lightweight web server such as :ref:`nginx <nginx-ref>`.
The WSGI servers serve the Python applications while the web server handles tasks
better suited for it such as static file serving, request routing, DDoS
protection, and basic authentication.
Hosting
:::::::
Platform-as-a-Service
---------------------
Platform-as-a-Service (PaaS) is a type of cloud computing infrastructure
which abstracts and manages infrastructure, routing, and scaling of web
applications. When using PaaS, application developers can focus on writing
application code rather than needing to be concerned with deployment
details.
Most PaaS services offer a command-line interface that developers can use to
set up and interrogate configuration, and to deploy new releases of an
application to the service.
PaaS services and their partners offer add-on functionality which is well
integrated into the platform, such as database hosting, email services,
logging, scheduled and background tasks, billing and payment, etc.
Heroku
~~~~~~
`Heroku <http://www.heroku.com/>`_'s
`Cedar stack <http://devcenter.heroku.com/articles/cedar>`_ offers first class
support for Python 2.7 applications.
Heroku allows you to run as many Python web applications as you like, 24/7 and free
of charge. Heroku is best described as a horizontal scaling platform. They start
to charge you once you "scale" you application to run on more than one Dyno
(abstacted servers) at a time.
Heroku publishes `step-by-step instructions
<http://devcenter.heroku.com/articles/python>`_ on how to set up your first
application for use in Heroku, and maintains a list of `example applications
<http://python.herokuapp.com/>`_.
DotCloud
~~~~~~~~
`DotCloud <http://www.dotcloud.com/>`_ supports WSGI applications and
background/worker tasks natively on their platform. Web applications running
Python version 2.6, and uses :ref:`nginx <nginx-ref>` and :ref:`uWSGI
<uwsgi-ref>`, and allows custom configuration of both
for advanced users.
DotCloud uses a custom command-line API client which can work with
applications managed in git repositories or any other version control
system.
DotCloud has a free plan with limited database size, and without extra
services (caching…).
See the `DotCloud documentation on Python
<http://docs.dotcloud.com/services/python/>`_ for more information and help
getting started.
ep.io
~~~~~
`ep.io <https://www.ep.io/>`_ is a PaaS designed specifically for Python web
applications. It supports Python versions 2.6 and 2.7, and has Pythonic
integrations with a variety of services.
ep.io has a free plan with bandwidth and disk space limitations. Also, in the
free plan, the web process is only loaded when needed. This means that the
first request after some inactivity may take up to 15 seconds.
ep.io publishes `step-by-step instructions
<https://www.ep.io/docs/quickstart/>`_ on how to get started with their
platform and how to deploy Django, Flask, or generic WSGI applications.
ep.io is currently in invite-only beta.
Gondor
~~~~~~
`Gondor <https://gondor.io/>`_ is a PaaS specailized for deploying Django
and Pinax applications. Gondor supports Django versions 1.2 and 1.3 on
Python version 2.7, and can automatically configure your Django site if you
use ``local_settings.py`` for site-specific configuration information.
Gondor publishes guides to deploying `Django projects
<https://gondor.io/support/setting-up-django/>`_ and `Pinax projects
<https://gondor.io/support/setting-up-pinax/>`_ on their platform.
.. rubric:: References
.. [1] `The mod_python project is now officially dead <http://blog.dscpl.com.au/2010/06/modpython-project-is-now-officially.html>`_
.. [2] `mod_wsgi vs mod_python <http://www.modpython.org/pipermail/mod_python/2007-July/024080.html>`_
.. [3] `Benchmark of Python WSGI Servers <http://nichol.as/benchmark-of-python-web-servers>`_
-49
View File
@@ -1,49 +0,0 @@
Freezing Your Code
==================
An alternative to shipping your code is freezing it — shipping it as an
executable with a bundled Python interpreter.
Many applications you use every day do this:
- Dropbox
- BitTorrent
-
.. todo:: Fill in "Freezing Your Code" stub
Windows
:::::::
py2exe
------
OSX
:::
py2app
------
PyInstaller
-----------
Linux
:::::
bbFreeze
--------
PyInstaller
-----------
-69
View File
@@ -1,69 +0,0 @@
Packaging Your Code
===================
Packaging your code is important.
.. todo:: Write introduction for "Packaging Your Code"
For Python Developers
:::::::::::::::::::::
If you're writing an open source Python module, `PyPI <http://pypi.python.org>`_, more properly known as *The Cheeseshop*, is the place to host it.
Pip vs. easy_install
--------------------
Use `pip <http://pypi.python.org/pypi/pip>`_. More details `here <http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install>`_
Personal PyPI
-------------
If you want to install packages from a source different from PyPI, (say, if
your packages are *proprietary*), you can do it by hosting a simple http server,
running from the directory which holds those packages which need to be installed.
**Showing an example is always beneficial**
Say if you are after installing a package called MyPackage.tar.gz, and assuming this is your directory structure
- archive
- MyPackage
- MyPackage.tar.gz
Go to your command prompt and type:
::
$ cd archive
$ python -m SimpleHTTPServer 9000
This runs a simple http server running on port 9000 and will list all packages (like **MyPackage**). Now you can install **MyPackage** using any python package installer. Using Pip, you would do it like:
::
$ pip install --extra-index-url=http://127.0.0.1:9000/ MyPackage
Having a folder with the same name as the package name is **crucial** here.
I got fooled by that, one time. But if you feel that creating a folder called
**MyPackage** and keeping **MyPackage.tar.gz** inside that, is *redundant*, you can still install MyPackage using:
::
$ pip install http://127.0.0.1:9000/MyPackage.tar.gz
Chishop
+++++++
`Chishop <https://github.com/benliles/djangopypi>`_ is a simple PyPI server written in django which allows you to register/upload with distutils and install with easy_install/pip.
For Linux Distributions
::::::::::::::::::::::::
.. todo:: Fill in "For Linux Distributions" packaging stub
Useful Tools
------------
- epm
- alien
-137
View File
@@ -1,137 +0,0 @@
Your Development Environment
============================
Text Editors
::::::::::::
VIM
---
There exist a couple of plugins and settings for the VIM editor to aid python
development. If you only develop in Python, a good start is to set the default
settings for indentation and linewrapping to values compliant with PEP8::
set textwidth=79
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround
With these settings newlines are inserted after 79 characters and indentation
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
handy plugin at indent_, which handles indentation settings for python source
files.
Additionally there is also a handy syntax plugin at syntax_ featuring some
improvements over the syntax file included in VIM 6.1.
These plugins supply you with a basic environment for developing in Python.
However in order to improve the programming flow we also want to continually
check for PEP8 compliance and check syntax. Luckily there exist PEP8_ and
Pyflakes_ to do this for you. If your VIM is compiled with `+python` you can
also utilize some very handy plugins to do these checks from within the editor.
For PEP8 checking install vim-pep8_. Now you can map the vim function
`Pep8()` to any hotkey or action you want. Similarly for pyflakes you can
install vim-pyflakes_. Now you can map `Pyflakes()` like the PEP8 function and
have it called quickly. Both plugins will display errors in a quickfix list and
provide an easy way to jump to the corresponding line. A very handy setting is
calling these functions whenever a buffer is saved. In order to do this, enter
the following lines into your vimrc::
autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()
.. _indent: http://www.vim.org/scripts/script.php?script_id=974
.. _syntax: http://www.vim.org/scripts/script.php?script_id=790
.. _Pyflakes: http://pypi.python.org/pypi/pyflakes/
.. _vim-pyflakes: https://github.com/nvie/vim-pyflakes
.. _PEP8: http://pypi.python.org/pypi/pep8/
.. _vim-pep8: https://github.com/nvie/vim-pep8
.. todo:: add supertab notes
IDEs
::::
PyCharm / IntelliJ IDEA
-----------------------
PyCharm is developed by JetBrains, also known for IntelliJ IDEA. Both share the same code base and most of PyCharm's features can be brought to IntelliJ with the free `Python Plug-In <http://plugins.intellij.net/plugin/?id=631/>`_..
Eclipse
-------
The most popular Eclipse plugin for Python development is Aptana's
`PyDev <http://pydev.org>`_.
Komodo IDE
-----------
`Komodo IDE <http://www.activestate.com/komodo-ide>`_ is developed by ActiveState and is a commerical IDE for Windows, Mac
and Linux.
Spyder
------
`Spyder <http://code.google.com/p/spyderlib/>`_ an IDE specifically geared toward working with scientific python libraries (namely `Scipy <http://www.scipy.org/>`_).
Includes integration with `pyflakes <http://pypi.python.org/pypi/pyflakes>`_, `pylint <http://www.logilab.org/857>`_,
and `rope <http://rope.sourceforge.net/>`_.
Spyder is open-source (free), offers code completion, syntax highlighting, class and function browser, and object
inspection
Interpreter Tools
:::::::::::::::::
virtualenv
----------
Virtualenv is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x" dilemma and keeps your global site-packages directory clean and manageable.
virtualenvwrapper
-----------------
Virtualenvwrapper makes virtualenv a pleasure to use by wrapping the command line API with a nicer CLI.
::
pip install virtualenvwrapper
Put this into your `~/.bash_profile` (Linux/Mac) file:
::
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
This will prevent your virtualenvs from relying on your (global) site packages directory, so that they are completely separate..
Other Tools
:::::::::::
IPython
-------
::
$ pip install ipython
BPython
-------
::
$ pip install bpython
-161
View File
@@ -1,161 +0,0 @@
Properly Installing Python
==========================
Mac OS X
::::::::
*Or, "Installing Python 2.7 via Homebrew".*
Package Manager
---------------
While Snow Leopard comes with a large number of UNIX utilities, those
familiar with Linux systems will notice one key component missing: a
package manager. Mxcl's *Homebrew* is the answer.
To install Homebrew, simply run: ::
$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
It's basic commands are **update**, **install**, and **remove**.
.. man brew
And we can now install Python 2.7: ::
$ brew install python --framework
The ``--framework`` option tells Homebrew to compile a Framework-style Python build, rather than a UNIX-style build. The outdated version of Python that Snow Leopard comes packaged with
is built as a Framework, so this helps avoid some future module installation
bugs.
*Don't forget to update your environment PATH.*
Building From Source
--------------------
Distribute & Pip
----------------
*Distribute* is a fantastic drop-in replacement for *easy_install* and
*setuptools*. It allows you to install and manage python packages from
pypi.python.org, amongst a few other sources. It also plays well with
*virtualenv* and user-enviornments.
**easy_install** is considered by many to be a deprecated system, so we
will install it's replacement: **pip**. Pip allows for uninstallation
of packages, and is actively maintained, unlike setuptool's easy_install.
To install *pip* and Distribute's *easy_install*:
If you have homebrew: ::
$ brew install pip
...And, if you're a masochist: ::
$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ easy_install pip
To install ``pip``: ::
Hopefully you'll never have to use **easy_install** again.
Updating Python
---------------
Homebrew makes it simple. ::
$ brew update
$ brew install --force python
Windows
:::::::
Prerequisites:
--------------
* Python2.7 (x86) from Python.org
* Microsoft Visual Studio
Step 1: Install Distribute & Pip
--------------------------------
**Distribute** is a fantastic drop-in replacement for **easy_install** and **setuptools**. It allows you to install and manage python packages from PyPi, amongst a few other sources.
To install it, run the python script available here:
<http://python-distribute.org/distribute_setup.py>
Make sure that ```C:\Python27\```, and ```C:\Python27\Scripts``` are in your PATH.
**easy_install** is considered by many to be a deprecated system, so we will install it's replacement: **pip**. Pip allows for uninstallation of packages, and is actively maintained, unlike setuptool's easy_install.
To install pip, simply run: ::
$ easy_install pip
Linux (Ubuntu)
::::::::::::::
Oneiric Ocelot, the latest version of Ubuntu, **comes with Python 2.7 out of the box**. Python 3.2 can be installed and run with the following commands::
$ sudo apt-get install python3-minimal
$ python3
Older versions of Python aren't available from the official repository. However, if it's needed (for example to support legacy code), we can add an unsupported repository and install an older version of Python (2.5 in the example below)::
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.5
Installing setuptools and pip
-----------------------------
While Python has an extensive standard library, the set of packages available from the Internet is even more extensive. In order to install them easily, we'll install the ``setuptools`` package and ``pip`` installer::
.. XXX: sudo?
$ wget http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py
$ rm get-pip.py distribute_setup.py
Now, most Python packages can be installed using the ``pip`` command. For example, if we wanted to install Django::
$ sudo pip install django
A full list of ``pip``'s capabilities is available by typing ``pip --help``.
Linux (Manual)
--------------
While your system will quite likely already have Python installation, you might wish to install a different version. This is done in the typical Linux software source install procedure::
$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
$ tar -xvf Python-2.7.2.tgz
$ cd Python-2.7.2
$ ./configure
$ make
$ make install
View File
-97
View File
@@ -1,97 +0,0 @@
Picking an Interpreter
======================
Which Python to use?
2.x vs 3.x
~~~~~~~~~~
**tl;dr**: Python 2.x is the status quo, Python 3.x is the shiny new thing.
`Further Reading <http://wiki.python.org/moin/Python2orPython3>`_
Today
-----
If you're choosing a Python interpreter to use, I *highly* recommend you Use Python 2.7.x, unless you have a strong reason not to.
The Future
----------
As more and more modules get ported over to Python3, the easier it will be for
others to use it.
Which Python to Support?
~~~~~~~~~~~~~~~~~~~~~~~~
If you're starting work on a new Python module, I recommend you write it for
Python 2.5 or 2.6, and add support for Python3 in a later iteration.
Implementations
~~~~~~~~~~~~~~~
There are several popular implementations of the Python programming language on
different back-ends.
CPython
-------
`CPython <http://www.python.org>`_ is the reference implementation of Python,
written in C. It compiles Python code to intermediate bytecode which is then
interpreted by a virtual machine. When people speak of *Python* they often mean
not just the language but also this implementation. It provides the highest
level of compatibility with Python packages and C extension modules.
If you are writing open-source Python code and want to reach the widest possible
audience, targeting CPython is your best bet. If you need to use any packages
that are rely on C extensions for their functionality (eg: numpy) then CPython
is your only choice.
Being the reference implementation, all versions of the Python language are
available as CPython. Python 3 is only available in a CPython implementation.
PyPy
----
`PyPy <http://pypy.org/>`_ is a Python interpreter implemented in a restricted
statically-typed subset of the Python language called RPython. The interpreter
features a just-in-time compiler and supports multiple back-ends (C, CLI, JVM).
PyPy aims for maximum compatibility with the reference CPython implementation
while improving performance.
If you are looking to squeeze more performance out of your Python code, it's
worth giving PyPy a try.
Currently PyPy supports Python 2.7.
Jython
------
`Jython <http://www.jython.org/>`_ is a Python implementation that compiles
Python code to Java byte code that then executes on a JVM. It has the additional
advantage of being able to import and use any Java class the same as a Python
module.
If you need to interface with an existing Java codebase or have other reasons to
need to write Python code for the JVM, Jython is the best choice.
Currently Jython supports up to Python 2.5.
IronPython
----------
`IronPython <http://ironpython.net/>`_ is an implementation of Python for .NET
framework. It can use both Python and .NET framework libraries, and can also
expose Python code to other .NET languages.
`Python Tools for Visual Studio <http://ironpython.net/tools/>`_ integrate
IronPython directly in to the Visual Studio development environment, making it
an ideal choice for Windows developers.
IronPython supports Python 2.7.
-76
View File
@@ -1,76 +0,0 @@
Documenting Your Code
=====================
Documenting your code is extremely important. It is debatebly even
more important than testing.
The Basics
::::::::::
Code Comments
-------------
Information regarding code comments is taken from PEP 008 (http://www.python.org/dev/peps/pep-0008/).
Block comment styling should be used when commenting out multiple lines of code.: ::
Block comments generally apply to some (or all) code that follows them,
and are indented to the same level as that code. Each line of a block
comment starts with a # and a single space (unless it is indented text
inside the comment).
Paragraphs inside a block comment are separated by a line containing a
single #.
Inline comments are used for individual lines and should be used sparingly.: ::
An inline comment is a comment on the same line as a statement. Inline
comments should be separated by at least two spaces from the statement.
They should start with a # and a single space.
Inline comments are unnecessary and in fact distracting if they state
the obvious. Don't do this:
x = x + 1 # Increment x
But sometimes, this is useful: ::
x = x + 1 # Compensate for border
Doc Strings
-----------
PEP 257 is the primary reference for docstrings. (http://www.python.org/dev/peps/pep-0257/)
|There are two types of docstrings, one-line and multi-line. Their names should be fairly self explanatory.
|One-line docstrings: ::
def kos_root():
"""Return the pathname of the KOS root directory."""
global _kos_root
if _kos_root: return _kos_root
...
Multi-line docstrings: ::
def complex(real=0.0, imag=0.0):
"""Form a complex number.
Keyword arguments:
real -- the real part (default 0.0)
imag -- the imaginary part (default 0.0)
"""
if imag == 0.0 and real == 0.0: return complex_zero
...
Sphinx
------
Sphinx (http://sphinx.pocoo.org) is a tool which converts documentation in the reStructured text markup language into a range of output formats including HTML, LaTeX (for printable PDF versions), manual pages and plain text.
Other Tools
:::::::::::
that old thing
--------------
pocco / docco / shocco
----------------------
Ronn
----
-54
View File
@@ -1,54 +0,0 @@
Choosing a License
==================
Open source.
Non-Restrictive
:::::::::::::::
PSFL
----
MIT / BSD / ISC
---------------
MIT (X11)
`````````
New BSD
```````
ISC
```
Apache
------
Restrictive
:::::::::::
LGPL
----
GPL
---
GPLv2
`````
GPLv3
`````
-22
View File
@@ -1,22 +0,0 @@
Structuring Your Project
========================
Structuring your project properly is extremely important.
Structure is Key
----------------
Vendorizing Dependencies
------------------------
Runners
-------
Further Reading
---------------
-54
View File
@@ -1,54 +0,0 @@
Code Style
==========
Idioms
::::::
Idiomatic Python code is often referred to as being *pythonic*.
Zen of Python
-------------
Also known as PEP 20, the guiding principles for Python's design.
::
>>> import this
See `<http://stackoverflow.com/questions/228181/the-zen-of-python>`_ for some
examples.
PEP 8
-----
PEP 8 is the de-facto code style guide for Python.
`PEP 8 <http://www.python.org/dev/peps/pep-0008/>`_
There exists a command-line program, `pep8` that can check your code for
conformance.
::
pip install pep8
Simply run it on a file or series of files and get a report of any
violations
::
$ pep8 optparse.py
optparse.py:69:11: E401 multiple imports on one line
optparse.py:77:1: E302 expected 2 blank lines, found 1
optparse.py:88:5: E301 expected 1 blank line, found 0
optparse.py:222:34: W602 deprecated form of raising exception
optparse.py:347:31: E211 whitespace before '('
optparse.py:357:17: E201 whitespace after '{'
optparse.py:472:29: E221 multiple spaces before operator
optparse.py:544:21: W601 .has_key() is deprecated, use 'in'
Conforming your style to PEP 8 is generally a good idea and helps make code a lot
more consistent when working on projects with other developers.
-158
View File
@@ -1,158 +0,0 @@
Testing Your Code
=====================
Testing your code is very important.
The Basics
::::::::::
Unittest
--------
Unittest is the batteries-included test module in the Python standard library.
Its API will be familiar to anyone who has used any of the JUnit/nUnit/CppUnit
series of tools.
Creating testcases is accomplished by subclassing a TestCase base class
::
import unittest
def fun(x):
return x + 1
class MyTest(unittest.TestCase):
def test(self):
self.assertEqual(fun(3), 4)
As of Python 2.7 unittest also includes its own test discovery mechanisms.
`unittest in the standard library documentation <http://docs.python.org/library/unittest.html>`_
Doctest
-------
The doctest module searches for pieces of text that look like interactive Python
sessions, and then executes those sessions to verify that they work exactly as
shown.
Tools
:::::
py.test
-------
py.test is a no-boilerplate alternative to Python's standard unittest module.
::
$ pip install pytest
Despite being a fully-featured and extensible test tool it boasts a simple
syntax. Creating a test suite is as easy as writing a module with a couple of
functions
::
# content of test_sample.py
def func(x):
return x + 1
def test_answer():
assert func(3) == 5
and then running the `py.test` command
::
$ py.test
=========================== test session starts ============================
platform darwin -- Python 2.7.1 -- pytest-2.2.1
collecting ... collected 1 items
test_sample.py F
================================= FAILURES =================================
_______________________________ test_answer ________________________________
def test_answer():
> assert func(3) == 5
E assert 4 == 5
E + where 4 = func(3)
test_sample.py:5: AssertionError
========================= 1 failed in 0.02 seconds =========================
far less work than would be required for the equivalent functionality with the
unittest module!
`py.test <http://pytest.org/latest/>`_
Nose
----
nose extends unittest to make testing easier.
::
$ pip install nose
nose provides automatic test discovery to save you the hassle of manually
creating test suites. It also provides numerous plugins for features such as
xUnit-compatible test output, coverage reporting, and test selection.
`nose <http://readthedocs.org/docs/nose/en/latest/>`_
tox
---
tox is a tool for automating test environment management and testing against multiple
interpreter configurations
::
$ pip install tox
tox allows you to configure complicatated multi-parameter test matrices via a
simple ini-style configuration file.
`tox <http://tox.testrun.org/latest/>`_
Unittest2
---------
unittest2 is a a backport of Python 2.7's unittest module which has an improved
API and better assertions over the one available in previous versions of Python.
If you're using Python 2.6 or below, you can install it with pip
::
$ pip install unittest2
You may want to import the module under the name unittest to make porting code
to newer versions of the module easier in the future
::
import unittest2 as unittest
class MyTest(unittest.TestCase):
...
This way if you ever switch to a newer python version and no longer need the
unittest2 module, you can simply change the import in your test module without
the need to change any other code.
`unittest2 <http://pypi.python.org/pypi/unittest2>`_
+2 -2
View File
@@ -79,11 +79,11 @@ div.sphinxsidebar input {
font-size: 1em;
}
div.sphinxsidebar input[type="text"] {
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
div.sphinxsidebar input[type="submit"] {
div.sphinxsidebar #searchbox input[type="submit"] {
width: 30px;
}
+1 -1
View File
@@ -2,7 +2,7 @@
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilties for all documentation.
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
-35
View File
@@ -528,41 +528,6 @@ a:hover tt {
}
}
/* scrollbars */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment {
display: block;
height: 10px;
}
::-webkit-scrollbar-button:vertical:increment {
background-color: #fff;
}
::-webkit-scrollbar-track-piece {
background-color: #eee;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:vertical {
height: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
::-webkit-scrollbar-thumb:horizontal {
width: 50px;
background-color: #ccc;
-webkit-border-radius: 3px;
}
/* misc. */
.revsys-inline {
+26 -23
View File
@@ -78,9 +78,19 @@ you can also use git submodules to check out the contents there.</p>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<div class="sphinxsidebarwrapper"><h1><a href="http://python-guide.org">Python Guide.</a></h1>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3>Donate</h3>
<p>
If you enjoy this guide, consider supporting the author <a href="https://www.gittip.com/kennethreitz/">on Gittip</a>:
</p>
<p>
<iframe style="border: 0; margin: 0; padding: 0;"
src="https://www.gittip.com/kennethreitz/widget.html"
width="48pt" height="20pt"></iframe>
</p><h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
@@ -111,32 +121,25 @@ you can also use git submodules to check out the contents there.</p>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<a href="https://github.com/kennethreitz/conductofcode" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '50431947613f5d52d2000031');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
-352
View File
@@ -1,352 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Your Development Environment &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Virtual Environments" href="virtualenvs.html" />
<link rel="prev" title="Linux" href="../starting/install/linux.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="virtualenvs.html" title="Virtual Environments"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../starting/install/linux.html" title="Linux"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="your-development-environment">
<h1>Your Development Environment<a class="headerlink" href="#your-development-environment" title="Permalink to this headline"></a></h1>
<div class="section" id="text-editors">
<h2>Text Editors<a class="headerlink" href="#text-editors" title="Permalink to this headline"></a></h2>
<p>Just about anything which can edit plain text will work for writing Python code,
however, using a more powerful editor may make your life a bit easier.</p>
<div class="section" id="vim">
<h3>VIM<a class="headerlink" href="#vim" title="Permalink to this headline"></a></h3>
<p>There exist a couple of plugins and settings for the VIM editor to aid python
development. If you only develop in Python, a good start is to set the default
settings for indentation and linewrapping to values compliant with PEP8:</p>
<div class="highlight-python"><pre>set textwidth=79
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround</pre>
</div>
<p>With these settings newlines are inserted after 79 characters and indentation
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
handy plugin at <a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=974">indent</a>, which handles indentation settings for python source
files.
Additionally there is also a handy syntax plugin at <a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=790">syntax</a> featuring some
improvements over the syntax file included in VIM 6.1.</p>
<p>These plugins supply you with a basic environment for developing in Python.
However in order to improve the programming flow we also want to continually
check for PEP8 compliance and check syntax. Luckily there exist <a class="reference external" href="http://pypi.python.org/pypi/pep8/">PEP8</a> and
<a class="reference external" href="http://pypi.python.org/pypi/pyflakes/">Pyflakes</a> to do this for you. If your VIM is compiled with <cite>+python</cite> you can
also utilize some very handy plugins to do these checks from within the editor.
For PEP8 checking install <a class="reference external" href="https://github.com/nvie/vim-pep8">vim-pep8</a>. Now you can map the vim function
<cite>Pep8()</cite> to any hotkey or action you want. Similarly for pyflakes you can
install <a class="reference external" href="https://github.com/nvie/vim-pyflakes">vim-pyflakes</a>. Now you can map <cite>Pyflakes()</cite> like the PEP8 function and
have it called quickly. Both plugins will display errors in a quickfix list and
provide an easy way to jump to the corresponding line. A very handy setting is
calling these functions whenever a buffer is saved. In order to do this, enter
the following lines into your vimrc:</p>
<div class="highlight-python"><pre>autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()</pre>
</div>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">add supertab notes</p>
</div>
</div>
<div class="section" id="textmate">
<h3>TextMate<a class="headerlink" href="#textmate" title="Permalink to this headline"></a></h3>
<p>&#8220;<a class="reference external" href="http://macromates.com/">TextMate</a> brings Apple&#8217;s approach to operating systems into the world of text editors. By bridging UNIX underpinnings and GUI, TextMate cherry-picks the best of both worlds to the benefit of expert scripters and novice users alike.&#8221;</p>
</div>
<div class="section" id="sublime-text">
<h3>Sublime Text<a class="headerlink" href="#sublime-text" title="Permalink to this headline"></a></h3>
<p>&#8220;<a class="reference external" href="http://www.sublimetext.com/">Sublime Text</a> is a sophisticated text editor
for code, html and prose. You&#8217;ll love the slick user interface and
extraordinary features.&#8221;</p>
<p>Sublime Text has excellent support for editing Python code and uses Python for
its plugin API.</p>
<p><a class="reference external" href="http://www.sublimetext.com/blog/articles/sublime-text-2-beta">Sublime Text 2</a> is currently in beta.</p>
</div>
</div>
<div class="section" id="ides">
<h2>IDEs<a class="headerlink" href="#ides" title="Permalink to this headline"></a></h2>
<div class="section" id="pycharm-intellij-idea">
<h3>PyCharm / IntelliJ IDEA<a class="headerlink" href="#pycharm-intellij-idea" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.jetbrains.com/pycharm/">PyCharm</a> is developed by JetBrains, also known for IntelliJ IDEA. Both share the same code base and most of PyCharm&#8217;s features can be brought to IntelliJ with the free <a class="reference external" href="http://plugins.intellij.net/plugin/?id=631/">Python Plug-In</a>.</p>
</div>
<div class="section" id="eclipse">
<h3>Eclipse<a class="headerlink" href="#eclipse" title="Permalink to this headline"></a></h3>
<p>The most popular Eclipse plugin for Python development is Aptana&#8217;s
<a class="reference external" href="http://pydev.org">PyDev</a>.</p>
</div>
<div class="section" id="komodo-ide">
<h3>Komodo IDE<a class="headerlink" href="#komodo-ide" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.activestate.com/komodo-ide">Komodo IDE</a> is developed by ActiveState and is a commerical IDE for Windows, Mac
and Linux.</p>
</div>
<div class="section" id="spyder">
<h3>Spyder<a class="headerlink" href="#spyder" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://code.google.com/p/spyderlib/">Spyder</a> an IDE specifically geared toward working with scientific python libraries (namely <a class="reference external" href="http://www.scipy.org/">Scipy</a>).
Includes integration with <a class="reference external" href="http://pypi.python.org/pypi/pyflakes/">pyflakes</a>, <a class="reference external" href="http://www.logilab.org/857">pylint</a>,
and <a class="reference external" href="http://rope.sourceforge.net/">rope</a>.</p>
<p>Spyder is open-source (free), offers code completion, syntax highlighting, class and function browser, and object inspection.</p>
</div>
</div>
<div class="section" id="interpreter-tools">
<h2>Interpreter Tools<a class="headerlink" href="#interpreter-tools" title="Permalink to this headline"></a></h2>
<div class="section" id="virtualenv">
<h3>virtualenv<a class="headerlink" href="#virtualenv" title="Permalink to this headline"></a></h3>
<p>Virtualenv is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them.
It solves the &#8220;Project X depends on version 1.x but, Project Y needs 4.x&#8221; dilemma and keeps your global site-packages directory clean and manageable.</p>
<p><a class="reference external" href="http://www.virtualenv.org/en/latest/index.html">virtualenv</a> creates
a folder which contains all the necessary executables to contain the
packages that a Python project would need. An example workflow is given.</p>
<p>Install virtualenv:</p>
<div class="highlight-python"><pre>$ pip install virtualenv</pre>
</div>
<p>Create a virtual environment for a project:</p>
<div class="highlight-python"><pre>$ cd my_project
$ virtualenv venv</pre>
</div>
<p><tt class="docutils literal"><span class="pre">virtualenv</span> <span class="pre">venv</span></tt> will create a folder in the currect directory
which will contain the Python executable files, and a copy of the <tt class="docutils literal"><span class="pre">pip</span></tt>
library which you can use to install other packages. The name of the
virtual environment (in this case, it was <tt class="docutils literal"><span class="pre">venv</span></tt>) can be anything;
omitting the name will place the files in the current directory instead.</p>
<p>In order the start using the virtual environment, run:</p>
<div class="highlight-python"><pre>$ source venv/bin/activate</pre>
</div>
<p>The name of the current virtual environment will now appear on the left
of the prompt (e.g. <tt class="docutils literal"><span class="pre">(venv)Your-Computer:your_project</span> <span class="pre">UserName$</span></tt>) to
let you know that it&#8217;s active. From now on, any package that you install
using <tt class="docutils literal"><span class="pre">pip</span></tt> will be placed in the venv folder, isolated from the global
Python installation. Install packages as usual:</p>
<div class="highlight-python"><pre>$ pip install requests</pre>
</div>
<p>To stop using an environment simply type <tt class="docutils literal"><span class="pre">deactivate</span></tt>. To remove the
environment, just remove the directory it was installed into. (In this
case, it would be <tt class="docutils literal"><span class="pre">rm</span> <span class="pre">-rf</span> <span class="pre">venv</span></tt>).</p>
<div class="section" id="other-notes">
<h4>Other Notes<a class="headerlink" href="#other-notes" title="Permalink to this headline"></a></h4>
<p>Running <tt class="docutils literal"><span class="pre">virtualenv</span></tt> with the option <tt class="docutils literal"><span class="pre">--no-site-packages</span></tt> will not
include the packages that are installed globally. This can be useful
for keeping the package list clean in case it needs to be accessed later.</p>
<p>In order to keep your environment consistent, it&#8217;s a good idea to &#8220;freeze&#8221;
the current state of the environment packages. To do this, run</p>
<div class="highlight-python"><pre>$ pip freeze &gt; requirements.txt</pre>
</div>
<p>This will create a <tt class="docutils literal"><span class="pre">requirements.txt</span></tt> file, which contains a simple
list of all the packages in the current environment, and their respective
versions. Later, when a different developer (or you, if you need to re-
create the environment) can install the same packages, with the same
versions by running</p>
<div class="highlight-python"><pre>$ pip install -r requirements.txt</pre>
</div>
<p>This can help ensure consistency across installations, across deployments,
and across developers.</p>
<p>Lastly, remember to exclude the virtual environment folder from source
control by adding it to the ignore list.</p>
</div>
</div>
<div class="section" id="virtualenvwrapper">
<h3>virtualenvwrapper<a class="headerlink" href="#virtualenvwrapper" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://pypi.python.org/pypi/virtualenvwrapper">Virtualenvwrapper</a> makes virtualenv a pleasure to use by wrapping the command line API with a nicer CLI.</p>
<div class="highlight-python"><pre>$ pip install virtualenvwrapper</pre>
</div>
<p>Put this into your <cite>~/.bash_profile</cite> (Linux/Mac) file:</p>
<div class="highlight-python"><pre>$ export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'</pre>
</div>
<p>This will prevent your virtualenvs from relying on your (global) site packages directory, so that they are completely separate..</p>
</div>
</div>
<div class="section" id="other-tools">
<h2>Other Tools<a class="headerlink" href="#other-tools" title="Permalink to this headline"></a></h2>
<div class="section" id="ipython">
<h3>IPython<a class="headerlink" href="#ipython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://ipython.org/">IPython</a> provides a rich toolkit to help you make the most out of using Python interactively. Its main components are:</p>
<ul class="simple">
<li>Powerful Python shells (terminal- and Qt-based).</li>
<li>A web-based notebook with the same core features but support for rich media, text, code, mathematical expressions and inline plots.</li>
<li>Support for interactive data visualization and use of GUI toolkits.</li>
<li>Flexible, embeddable interpreters to load into your own projects.</li>
<li>Tools for high level and interactive parallel computing.</li>
</ul>
<div class="highlight-python"><pre>$ pip install ipython</pre>
</div>
</div>
<div class="section" id="bpython">
<h3>BPython<a class="headerlink" href="#bpython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://bpython-interpreter.org/">bpython</a> is an alternative interface to the Python interpreter for Unix-like operating systems. It has the following features:</p>
<ul class="simple">
<li>In-line syntax highlighting.</li>
<li>Readline-like autocomplete with suggestions displayed as you type.</li>
<li>Expected parameter list for any Python function.</li>
<li>&#8220;Rewind&#8221; function to pop the last line of code from memory and re-evaluate.</li>
<li>Send entered code off to a pastebin.</li>
<li>Save entered code to a file.</li>
<li>Auto-indentation.</li>
<li>Python 3 support.</li>
</ul>
<div class="highlight-python"><pre>$ pip install bpython</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Your Development Environment</a><ul>
<li><a class="reference internal" href="#text-editors">Text Editors</a><ul>
<li><a class="reference internal" href="#vim">VIM</a></li>
<li><a class="reference internal" href="#textmate">TextMate</a></li>
<li><a class="reference internal" href="#sublime-text">Sublime Text</a></li>
</ul>
</li>
<li><a class="reference internal" href="#ides">IDEs</a><ul>
<li><a class="reference internal" href="#pycharm-intellij-idea">PyCharm / IntelliJ IDEA</a></li>
<li><a class="reference internal" href="#eclipse">Eclipse</a></li>
<li><a class="reference internal" href="#komodo-ide">Komodo IDE</a></li>
<li><a class="reference internal" href="#spyder">Spyder</a></li>
</ul>
</li>
<li><a class="reference internal" href="#interpreter-tools">Interpreter Tools</a><ul>
<li><a class="reference internal" href="#virtualenv">virtualenv</a><ul>
<li><a class="reference internal" href="#other-notes">Other Notes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#virtualenvwrapper">virtualenvwrapper</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-tools">Other Tools</a><ul>
<li><a class="reference internal" href="#ipython">IPython</a></li>
<li><a class="reference internal" href="#bpython">BPython</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../starting/install/linux.html" title="previous chapter">Linux</a></li>
<li>Next: <a href="virtualenvs.html" title="next chapter">Virtual Environments</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/dev/env.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-263
View File
@@ -1,263 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Virtual Environments &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Structuring Your Project" href="../writing/structure.html" />
<link rel="prev" title="Your Development Environment" href="env.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../writing/structure.html" title="Structuring Your Project"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="env.html" title="Your Development Environment"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="virtual-environments">
<h1>Virtual Environments<a class="headerlink" href="#virtual-environments" title="Permalink to this headline"></a></h1>
<p>A Virtual Environment, put simply, is an isolated working copy of Python which
allows you to work on a specific project without worry of affecting other
projects.</p>
<p>For example, you can work on a project which requires Django 1.3 while also
maintaining a project which requires Django 1.0.</p>
<div class="section" id="virtualenv">
<h2>virtualenv<a class="headerlink" href="#virtualenv" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> is a tool to create
isolated Python environments.</p>
<p>Install it via pip:</p>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> pip install virtualenv
</pre></div>
</div>
<div class="section" id="basic-usage">
<h3>Basic Usage<a class="headerlink" href="#basic-usage" title="Permalink to this headline"></a></h3>
<ol class="arabic simple">
<li>Create a virtual environment:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> virtualenv venv
</pre></div>
</div>
<p>This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named <tt class="docutils literal"><span class="pre">venv</span></tt>.</p>
<ol class="arabic simple" start="2">
<li>To begin using the virtual environment, it needs to be activated:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> <span class="nb">source </span>venv/bin/activate
</pre></div>
</div>
<p>You can then begin installing any new modules without affecting the system
default Python or other virtual environments.</p>
<ol class="arabic simple" start="3">
<li>If you are done working in the virtual environment for the moment, you can
deactivate it:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> deactivate
</pre></div>
</div>
<p>This puts you back to the system&#8217;s default Python interpreter with all its
installed libraries.</p>
<p>To delete a virtual environment, just delete its folder.</p>
<p>After a while, though, you might end up with a lot of virtual environments
littered across your system, and its possible you&#8217;ll forget their names or
where they were placed.</p>
</div>
</div>
<div class="section" id="virtualenvwrapper">
<h2>virtualenvwrapper<a class="headerlink" href="#virtualenvwrapper" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://www.doughellmann.com/projects/virtualenvwrapper/">virtualenvwrapper</a>
provides a set of commands which makes working with virtual environments much
more pleasant. It also places all your virtual environments in one place.</p>
<p>To install (make sure <strong>virtualenv</strong> is already installed):</p>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> pip install virtualenvwrapper
<span class="gp">$</span> <span class="nb">export </span><span class="nv">WORKON_HOME</span><span class="o">=</span>~/Envs
<span class="gp">$</span> <span class="nb">source</span> /usr/local/bin/virtualenvwrapper.sh
</pre></div>
</div>
<p>(<a class="reference external" href="http://www.doughellmann.com/docs/virtualenvwrapper/#introduction">Full virtualenvwrapper install instructions</a>.)</p>
<div class="section" id="id3">
<h3>Basic Usage<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h3>
<ol class="arabic simple">
<li>Create a virtual environment:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> mkvirtualenv venv
</pre></div>
</div>
<p>This creates the <tt class="docutils literal"><span class="pre">venv</span></tt> folder inside <tt class="docutils literal"><span class="pre">~/Envs</span></tt>.</p>
<ol class="arabic simple" start="2">
<li>Work on a virtual environment:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> workon venv
</pre></div>
</div>
<p><strong>virtualenvwrapper</strong> provides tab-completion on environment names. It really
helps when you have a lot of environments and have trouble remembering their
names.
<tt class="docutils literal"><span class="pre">workon</span></tt> also deactivates whatever environment you are currently in, so you
can quickly switch between environments.</p>
<ol class="arabic simple" start="3">
<li>Deactivating is still the same:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> deactivate
</pre></div>
</div>
<ol class="arabic simple" start="4">
<li>To delete:</li>
</ol>
<div class="highlight-console"><div class="highlight"><pre><span class="gp">$</span> rmvirtualenv venv
</pre></div>
</div>
</div>
<div class="section" id="other-useful-commands">
<h3>Other useful commands<a class="headerlink" href="#other-useful-commands" title="Permalink to this headline"></a></h3>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">lsvirtualenv</span></tt></dt>
<dd>List all of the environments.</dd>
<dt><tt class="docutils literal"><span class="pre">cdvirtualenv</span></tt></dt>
<dd>Navigate into the directory of the currently activated virtual environment,
so you can browse its <tt class="docutils literal"><span class="pre">site-packages</span></tt>, for example.</dd>
<dt><tt class="docutils literal"><span class="pre">cdsitepackages</span></tt></dt>
<dd>Like the above, but directly into <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</dd>
<dt><tt class="docutils literal"><span class="pre">lssitepackages</span></tt></dt>
<dd>Shows contents of <tt class="docutils literal"><span class="pre">site-packages</span></tt> directory.</dd>
</dl>
<p><a class="reference external" href="http://www.doughellmann.com/docs/virtualenvwrapper/command_ref.html#managing-environments">Full list of virtualenvwrapper commands</a>.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Virtual Environments</a><ul>
<li><a class="reference internal" href="#virtualenv">virtualenv</a><ul>
<li><a class="reference internal" href="#basic-usage">Basic Usage</a></li>
</ul>
</li>
<li><a class="reference internal" href="#virtualenvwrapper">virtualenvwrapper</a><ul>
<li><a class="reference internal" href="#id3">Basic Usage</a></li>
<li><a class="reference internal" href="#other-useful-commands">Other useful commands</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="env.html" title="previous chapter">Your Development Environment</a></li>
<li>Next: <a href="../writing/structure.html" title="next chapter">Structuring Your Project</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/dev/virtualenvs.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
+27 -19
View File
@@ -60,9 +60,19 @@
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<div class="sphinxsidebarwrapper"><h1><a href="http://python-guide.org">Python Guide.</a></h1>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3>Donate</h3>
<p>
If you enjoy this guide, consider supporting the author <a href="https://www.gittip.com/kennethreitz/">on Gittip</a>:
</p>
<p>
<iframe style="border: 0; margin: 0; padding: 0;"
src="https://www.gittip.com/kennethreitz/widget.html"
width="48pt" height="20pt"></iframe>
</p><h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
@@ -86,29 +96,27 @@
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<a href="https://github.com/kennethreitz/conductofcode" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '50431947613f5d52d2000031');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
+36 -255
View File
@@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Hitchhikers Guide to Python! &mdash; pythonguide 0.0.1 documentation</title>
<title>The Conduct of Code &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@@ -25,7 +25,6 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="#" />
<link rel="next" title="Picking an Interpreter" href="starting/which-python.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
@@ -38,9 +37,6 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="starting/which-python.html" title="Picking an Interpreter"
accesskey="N">next</a> |</li>
<li><a href="#">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
@@ -50,233 +46,15 @@
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-hitchhiker-s-guide-to-python">
<h1>The Hitchhiker&#8217;s Guide to Python!<a class="headerlink" href="#the-hitchhiker-s-guide-to-python" title="Permalink to this headline"></a></h1>
<p>Welcome to The Hitchhiker&#8217;s Guide to Python. <strong>DON&#8217;T PANIC!</strong></p>
<p><strong>This guide is currently under heavy development, and is mostly a skeleton at the moment.</strong> If you&#8217;d like to help, <a class="reference external" href="https://github.com/kennethreitz/python-guide">fork us on GitHub</a>!</p>
<p>This <em>opinionated</em> guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.</p>
<div class="section" id="getting-started">
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline"></a></h2>
<p>This part of the guide focuses on setting up your Python environment.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="starting/which-python.html">Picking an Interpreter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="starting/which-python.html#x-vs-3-x">2.x vs 3.x</a></li>
<li class="toctree-l2"><a class="reference internal" href="starting/which-python.html#which-python-to-support">Which Python to Support?</a></li>
<li class="toctree-l2"><a class="reference internal" href="starting/which-python.html#implementations">Implementations</a></li>
</ul>
</li>
</ul>
</div>
<ul class="simple">
<li>Properly Install Python</li>
</ul>
<blockquote>
<div><div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="starting/install/osx.html">Mac OS X</a></li>
<li class="toctree-l1"><a class="reference internal" href="starting/install/win.html">Windows</a></li>
<li class="toctree-l1"><a class="reference internal" href="starting/install/linux.html">Linux</a></li>
</ul>
</div>
</div></blockquote>
</div>
<div class="section" id="development-environment">
<h2>Development Environment<a class="headerlink" href="#development-environment" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="dev/env.html">Your Development Environment</a><ul>
<li class="toctree-l2"><a class="reference internal" href="dev/env.html#text-editors">Text Editors</a></li>
<li class="toctree-l2"><a class="reference internal" href="dev/env.html#ides">IDEs</a></li>
<li class="toctree-l2"><a class="reference internal" href="dev/env.html#interpreter-tools">Interpreter Tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="dev/env.html#other-tools">Other Tools</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="dev/virtualenvs.html">Virtual Environments</a><ul>
<li class="toctree-l2"><a class="reference internal" href="dev/virtualenvs.html#virtualenv">virtualenv</a></li>
<li class="toctree-l2"><a class="reference internal" href="dev/virtualenvs.html#virtualenvwrapper">virtualenvwrapper</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="writing-great-code">
<h2>Writing Great Code<a class="headerlink" href="#writing-great-code" title="Permalink to this headline"></a></h2>
<p>This part of the guide focuses on best practices for writing Python code.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="writing/structure.html">Structuring Your Project</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing/structure.html#structure-is-key">Structure is Key</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/structure.html#vendorizing-dependencies">Vendorizing Dependencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/structure.html#runners">Runners</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/structure.html#further-reading">Further Reading</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="writing/style.html">Code Style</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing/style.html#idioms">Idioms</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="writing/documentation.html">Documenting Your Code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing/documentation.html#the-basics">The Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/documentation.html#other-tools">Other Tools</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="writing/tests.html">Testing Your Code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing/tests.html#the-basics">The Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/tests.html#tools">Tools</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="writing/license.html">Choosing a License</a><ul>
<li class="toctree-l2"><a class="reference internal" href="writing/license.html#non-restrictive">Non-Restrictive</a></li>
<li class="toctree-l2"><a class="reference internal" href="writing/license.html#restrictive">Restrictive</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="scenario-guide">
<h2>Scenario Guide<a class="headerlink" href="#scenario-guide" title="Permalink to this headline"></a></h2>
<p>This part of the guide focuses on tool and module advice based on
different scenarios.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="scenarios/web.html">Web Applications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#context">Context</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#frameworks">Frameworks</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#web-servers">Web Servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#wsgi-servers">WSGI Servers</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#server-best-practices">Server Best Practices</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/web.html#hosting">Hosting</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/cli.html">Command Line Applications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/cli.html#clint">Clint</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/gui.html">GUI Applications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/gui.html#qt">Qt</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/gui.html#cocoa">Cocoa</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/gui.html#wxpython">WXPython</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/gui.html#gtk">Gtk</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/gui.html#tk">Tk</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/db.html">Databases</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/db.html#db-api">DB-API</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/db.html#sqlalchemy">SQLAlchemy</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/db.html#django-orm">Django ORM</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/admin.html">Systems Administration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/admin.html#fabric">Fabric</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/admin.html#chef">Chef</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/admin.html#puppet">Puppet</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/admin.html#blueprint">Blueprint</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/admin.html#buildout">Buildout</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/ci.html">Continuous Integration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/ci.html#why">Why?</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/ci.html#jenkins">Jenkins</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/ci.html#buildbot">Buildbot</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/ci.html#mule">Mule?</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/ci.html#tox">Tox</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/speed.html">Speed</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/speed.html#context">Context</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/speed.html#id2">C Extentions</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/speed.html#threading">Threading</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="scenarios/scientific.html">Scientific Applications</a><ul>
<li class="toctree-l2"><a class="reference internal" href="scenarios/scientific.html#context">Context</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/scientific.html#libraries">Libraries</a></li>
<li class="toctree-l2"><a class="reference internal" href="scenarios/scientific.html#resources">Resources</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="shipping-great-code">
<h2>Shipping Great Code<a class="headerlink" href="#shipping-great-code" title="Permalink to this headline"></a></h2>
<p>This part of the guide focuses on deploying your Python code.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="shipping/packaging.html">Packaging Your Code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="shipping/packaging.html#for-python-developers">For Python Developers</a></li>
<li class="toctree-l2"><a class="reference internal" href="shipping/packaging.html#for-linux-distributions">For Linux Distributions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="shipping/freezing.html">Freezing Your Code</a><ul>
<li class="toctree-l2"><a class="reference internal" href="shipping/freezing.html#windows">Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="shipping/freezing.html#osx">OSX</a></li>
<li class="toctree-l2"><a class="reference internal" href="shipping/freezing.html#linux">Linux</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="additional-notes">
<h2>Additional Notes<a class="headerlink" href="#additional-notes" title="Permalink to this headline"></a></h2>
<p>This part of the guide, which is mostly prose, begins with some
background information about Python, then focuses on next steps.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="intro/duction.html">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro/duction.html#about-this-guide">About This Guide</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro/community.html">The Community</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro/community.html#bdfl">BDFL</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/community.html#python-software-foundation">Python Software Foundation</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/community.html#peps">PEPs</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/community.html#python-conferences">Python Conferences</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/community.html#python-user-groups">Python User Groups</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro/learning.html">Learning Python</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro/learning.html#beginner">Beginner</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/learning.html#advanced">Advanced</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro/documentation.html">Documentation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro/documentation.html#official-documentation">Official Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/documentation.html#read-the-docs">Read the Docs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="intro/news.html">News</a><ul>
<li class="toctree-l2"><a class="reference internal" href="intro/news.html#planet-python">Planet Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/news.html#r-python">/r/python</a></li>
<li class="toctree-l2"><a class="reference internal" href="intro/news.html#python-weekly">Python Weekly</a></li>
</ul>
</li>
</ul>
</div>
<hr class="docutils" />
<p>Contibution notes and legal information are here (for those interested).</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="notes/contribute.html">Contribute</a><ul>
<li class="toctree-l2"><a class="reference internal" href="notes/contribute.html#style-guide">Style Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/contribute.html#todo-list">Todo List</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="notes/license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="notes/styleguide.html">The Guide Style Guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#relevancy">Relevancy</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#headings">Headings</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#prose">Prose</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#code-examples">Code Examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#externally-linking">Externally Linking</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#linking-to-sections-in-the-guide">Linking to Sections in The Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#notes-and-warnings">Notes and Warnings</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes/styleguide.html#todos">TODOs</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="the-conduct-of-code">
<h1>The Conduct of Code<a class="headerlink" href="#the-conduct-of-code" title="Permalink to this headline"></a></h1>
<p>Welcome to The Hitchhiker&#8217;s Guide to Python. <a class="reference external" href="http://www.amazon.com/gp/product/B0043M4ZH0/ref=as_li_ss_tl?ie=UTF8&amp;tag=bookforkind-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0043M4ZH0">DON&#8217;T PANIC!</a></p>
<p><strong>This guide is currently under heavy development, and is mostly a skeleton at
the moment.</strong> If you&#8217;d like to help, <a class="reference external" href="https://github.com/kennethreitz/python-guide">fork us on GitHub</a>!</p>
<p>This <em>opinionated</em> guide exists to provide both novice and expert Python
developers a best-practice handbook to the installation, configuration, and
usage of Python on a daily basis.</p>
<p>stuff.</p>
</div>
@@ -284,11 +62,21 @@ background information about Python, then focuses on next steps.</p>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3>Python Guide</h3>
<div class="sphinxsidebarwrapper"><h1>Conduct of Code.</h1>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3>Donate</h3>
<p>
If you enjoy this guide, consider supporting the author <a href="https://www.gittip.com/kennethreitz/">on Gittip</a>:
</p>
<p>
<iframe style="border: 0; margin: 0; padding: 0;"
src="https://www.gittip.com/kennethreitz/widget.html"
width="48pt" height="20pt"></iframe>
</p>
<h3>Feedback</h3>
<p>
Feedback is greatly appreciated. If you have any questions, comments,
@@ -328,32 +116,25 @@ background information about Python, then focuses on next steps.</p>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<a href="https://github.com/kennethreitz/conductofcode" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '50431947613f5d52d2000031');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
-222
View File
@@ -1,222 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Community &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Learning Python" href="learning.html" />
<link rel="prev" title="Introduction" href="duction.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="learning.html" title="Learning Python"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="duction.html" title="Introduction"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-community">
<h1>The Community<a class="headerlink" href="#the-community" title="Permalink to this headline"></a></h1>
<div class="section" id="bdfl">
<h2>BDFL<a class="headerlink" href="#bdfl" title="Permalink to this headline"></a></h2>
<p>Guido van Rossum, the creator of Python, is often referred to as the BDFL — the Benevolent Dictator For Life.</p>
</div>
<div class="section" id="python-software-foundation">
<h2>Python Software Foundation<a class="headerlink" href="#python-software-foundation" title="Permalink to this headline"></a></h2>
<p>The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers.</p>
<p><a class="reference external" href="http://www.python.org/psf/">Learn More about the PSF</a>.</p>
</div>
<div class="section" id="peps">
<h2>PEPs<a class="headerlink" href="#peps" title="Permalink to this headline"></a></h2>
<p>PEPs are <em>Python Enhancement Proposals</em>. They describe changes to Python itself, or the standards around it.</p>
<p>There are three different types of PEPs (as defined by <a class="reference external" href="http://www.python.org/dev/peps/pep-0001/">PEP1</a>):</p>
<blockquote>
<div><dl class="docutils">
<dt><strong>Standards</strong></dt>
<dd>Describes a new feature or implementation.</dd>
<dt><strong>Informational</strong></dt>
<dd>Describes a design issue, general guidelines, or information to the community.</dd>
<dt><strong>Process</strong></dt>
<dd>Describes a process related to Python.</dd>
</dl>
</div></blockquote>
<div class="section" id="notable-peps">
<h3>Notable PEPs<a class="headerlink" href="#notable-peps" title="Permalink to this headline"></a></h3>
<p>There are a few PEPs that could be considered required reading:</p>
<ul>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://www.python.org/dev/peps/pep-0008/">PEP8</a>: The Python Style Guide.</dt>
<dd><p class="first last">Read this. All of it. Follow it.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://www.python.org/dev/peps/pep-0020/">PEP20</a>: The Zen of Python.</dt>
<dd><p class="first last">A list of 19 statements that briefly explain the philosophy behind Python.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://www.python.org/dev/peps/pep-0257/">PEP257</a>: Docstring Conventions.</dt>
<dd><p class="first last">Gives guidelines for semantics and conventions associated with Python docstrings.</p>
</dd>
</dl>
</li>
</ul>
<p>You can read more at <a class="reference external" href="http://www.python.org/dev/peps/">The PEP Index</a>.</p>
</div>
<div class="section" id="submitting-a-pep">
<h3>Submitting a PEP<a class="headerlink" href="#submitting-a-pep" title="Permalink to this headline"></a></h3>
<blockquote>
<div><p>PEPs are peer-reviewed and accepted/rejected after much discussion. Anyone can write and submit a PEP for review.</p>
<p>Here&#8217;s an overview of the PEP acceptance workflow:</p>
<img alt="http://www.python.org/dev/peps/pep-0001/pep-0001-1.png" src="http://www.python.org/dev/peps/pep-0001/pep-0001-1.png" />
</div></blockquote>
</div>
</div>
<div class="section" id="python-conferences">
<h2>Python Conferences<a class="headerlink" href="#python-conferences" title="Permalink to this headline"></a></h2>
<p>The major events for the Python community are developer conferences. The two most notable conferences are PyCon, which is held in the US, and its European sibling, EuroPython.</p>
<p>A comprehensive list of conferences is maintained <a class="reference external" href="http://www.pycon.org/">at pycon.org</a>.</p>
</div>
<div class="section" id="python-user-groups">
<h2>Python User Groups<a class="headerlink" href="#python-user-groups" title="Permalink to this headline"></a></h2>
<p>User Groups are where a bunch of Python developers meet to present or talk about Python topics of interest. A list of local user groups is maintained at the <a class="reference external" href="http://wiki.python.org/moin/LocalUserGroups">Python Software Foundation Wiki</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The Community</a><ul>
<li><a class="reference internal" href="#bdfl">BDFL</a></li>
<li><a class="reference internal" href="#python-software-foundation">Python Software Foundation</a></li>
<li><a class="reference internal" href="#peps">PEPs</a><ul>
<li><a class="reference internal" href="#notable-peps">Notable PEPs</a></li>
<li><a class="reference internal" href="#submitting-a-pep">Submitting a PEP</a></li>
</ul>
</li>
<li><a class="reference internal" href="#python-conferences">Python Conferences</a></li>
<li><a class="reference internal" href="#python-user-groups">Python User Groups</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="duction.html" title="previous chapter">Introduction</a></li>
<li>Next: <a href="learning.html" title="next chapter">Learning Python</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/intro/community.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-165
View File
@@ -1,165 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documentation &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="News" href="news.html" />
<link rel="prev" title="Learning Python" href="learning.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="news.html" title="News"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="learning.html" title="Learning Python"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="documentation">
<h1>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline"></a></h1>
<div class="section" id="official-documentation">
<h2>Official Documentation<a class="headerlink" href="#official-documentation" title="Permalink to this headline"></a></h2>
<p>The official Python Language and Library documentation can be found here:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference external" href="http://docs.python.org/">Python 2.x</a></li>
<li><a class="reference external" href="http://docs.python.org/py3k/">Python 3.x</a></li>
</ul>
</div></blockquote>
</div>
<div class="section" id="read-the-docs">
<h2>Read the Docs<a class="headerlink" href="#read-the-docs" title="Permalink to this headline"></a></h2>
<p>Read the Docs is a popular community project, providing a single location for all documentation of popular and even more exotic Python modules.</p>
<blockquote>
<div><a class="reference external" href="http://readthedocs.org/">Read the Docs</a></div></blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Documentation</a><ul>
<li><a class="reference internal" href="#official-documentation">Official Documentation</a></li>
<li><a class="reference internal" href="#read-the-docs">Read the Docs</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="learning.html" title="previous chapter">Learning Python</a></li>
<li>Next: <a href="news.html" title="next chapter">News</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/intro/documentation.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-182
View File
@@ -1,182 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="The Community" href="community.html" />
<link rel="prev" title="Freezing Your Code" href="../shipping/freezing.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="community.html" title="The Community"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../shipping/freezing.html" title="Freezing Your Code"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">write a general blurb introducing the Python language</p>
</div>
<div class="section" id="about-this-guide">
<span id="about-ref"></span><h2>About This Guide<a class="headerlink" href="#about-this-guide" title="Permalink to this headline"></a></h2>
<div class="section" id="purpose">
<h3>Purpose<a class="headerlink" href="#purpose" title="Permalink to this headline"></a></h3>
<p>The Hitchhiker&#8217;s Guide to Python exists to provide both novice and expert
Python developers a best-practice handbook to the installation, configuration,
and usage of Python on a daily basis.</p>
</div>
<div class="section" id="by-the-community">
<h3>By the Community<a class="headerlink" href="#by-the-community" title="Permalink to this headline"></a></h3>
<p>This guide is architected and maintained by <a class="reference external" href="https://github.com/kennethreitz">Kenneth Reitz</a> in an open fashion. This is a
community-driven effort that serves one purpose: to serve the community.</p>
</div>
<div class="section" id="for-the-community">
<h3>For the Community<a class="headerlink" href="#for-the-community" title="Permalink to this headline"></a></h3>
<p>All contributions to the Guide are welcome, from Pythonistas of all levels.
If you think there&#8217;s a gap in what the Guide covers, fork the Guide on
GitHub and submit a pull request. Contributions are welcome from everyone,
whether they&#8217;re an old hand or a first-time Pythonista, and the authors to
the Guide will gladly help if you have any questions about the
appropriateness, completeness, or accuracy of a contribution.</p>
<p>To get started working on The Hitchhiker&#8217;s Guide, see
the <a class="reference internal" href="../notes/contribute.html"><em>Contribute</em></a> page.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#about-this-guide">About This Guide</a><ul>
<li><a class="reference internal" href="#purpose">Purpose</a></li>
<li><a class="reference internal" href="#by-the-community">By the Community</a></li>
<li><a class="reference internal" href="#for-the-community">For the Community</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../shipping/freezing.html" title="previous chapter">Freezing Your Code</a></li>
<li>Next: <a href="community.html" title="next chapter">The Community</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/intro/duction.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-219
View File
@@ -1,219 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Learning Python &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Documentation" href="documentation.html" />
<link rel="prev" title="The Community" href="community.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="documentation.html" title="Documentation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="community.html" title="The Community"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="learning-python">
<h1>Learning Python<a class="headerlink" href="#learning-python" title="Permalink to this headline"></a></h1>
<div class="section" id="beginner">
<h2>Beginner<a class="headerlink" href="#beginner" title="Permalink to this headline"></a></h2>
<div class="section" id="learn-python-interactive-tutorial">
<h3>Learn Python Interactive Tutorial<a class="headerlink" href="#learn-python-interactive-tutorial" title="Permalink to this headline"></a></h3>
<p>Learnpython.org is an easy non-intimidating way to get introduced to python. The website takes the same approach used on the popular <a class="reference external" href="http://tryruby.org/">Try Ruby</a> website, it has an interactive python interpreter built into the site that allows you to go through the lessons without having to install Python locally.</p>
<blockquote>
<div><a class="reference external" href="http://www.learnpython.org/">Learn Python</a></div></blockquote>
</div>
<div class="section" id="learn-python-the-hard-way">
<h3>Learn Python the Hard Way<a class="headerlink" href="#learn-python-the-hard-way" title="Permalink to this headline"></a></h3>
<p>This is an excellent beginner programmer&#8217;s guide to Python. It covers &#8220;hello world&#8221; from the console to the web.</p>
<blockquote>
<div><a class="reference external" href="http://learnpythonthehardway.org/book/">Learn Python the Hard Way</a></div></blockquote>
</div>
<div class="section" id="crash-into-python">
<h3>Crash into Python<a class="headerlink" href="#crash-into-python" title="Permalink to this headline"></a></h3>
<p>Also known as <em>Python for Programmers with 3 Hours</em>, this guide gives experienced developers from other languages a crash course on Python.</p>
<blockquote>
<div><a class="reference external" href="http://stephensugden.com/crash_into_python/">Crash into Python</a></div></blockquote>
</div>
<div class="section" id="dive-into-python-3">
<h3>Dive Into Python 3<a class="headerlink" href="#dive-into-python-3" title="Permalink to this headline"></a></h3>
<p>Dive Into Python 3 is a good book for those ready to jump in to Python 3. It&#8217;s a
good read if you are moving from Python 2 to 3 or if you already have some
experience programming in another language.</p>
<blockquote>
<div><a class="reference external" href="http://diveintopython3.ep.io/">Dive Into Python 3</a></div></blockquote>
</div>
<div class="section" id="think-python-how-to-think-like-a-computer-scientist">
<h3>Think Python: How to Think Like a Computer Scientist<a class="headerlink" href="#think-python-how-to-think-like-a-computer-scientist" title="Permalink to this headline"></a></h3>
<p>Think Python attempts to give an introduction to basic concepts in computer science through the
use of the python language. The focus was to create a book with plenty of exercises, minimal jargon and
a section in each chapter devoted to the subject of debugging.</p>
<p>While exploring the various features available in the python language the author weaves in various design
patterns and best practices.</p>
<p>The book also includes several case studies which have the reader explore the topics discussed in the book
in greater detail by applying those topics to real-world examples. Case studies include assignments in GUI
and Markov Analysis.</p>
<blockquote>
<div><a class="reference external" href="http://greenteapress.com/thinkpython/html/index.html">Think Python</a></div></blockquote>
</div>
</div>
<div class="section" id="advanced">
<h2>Advanced<a class="headerlink" href="#advanced" title="Permalink to this headline"></a></h2>
<div class="section" id="pro-python">
<h3>Pro Python<a class="headerlink" href="#pro-python" title="Permalink to this headline"></a></h3>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about <a class="reference external" href="http://propython.com/">Pro Python</a></p>
</div>
</div>
<div class="section" id="expert-python-programming">
<h3>Expert Python Programming<a class="headerlink" href="#expert-python-programming" title="Permalink to this headline"></a></h3>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about <a class="reference external" href="http://www.packtpub.com/expert-python-programming/book">Expert Python Programming</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Learning Python</a><ul>
<li><a class="reference internal" href="#beginner">Beginner</a><ul>
<li><a class="reference internal" href="#learn-python-interactive-tutorial">Learn Python Interactive Tutorial</a></li>
<li><a class="reference internal" href="#learn-python-the-hard-way">Learn Python the Hard Way</a></li>
<li><a class="reference internal" href="#crash-into-python">Crash into Python</a></li>
<li><a class="reference internal" href="#dive-into-python-3">Dive Into Python 3</a></li>
<li><a class="reference internal" href="#think-python-how-to-think-like-a-computer-scientist">Think Python: How to Think Like a Computer Scientist</a></li>
</ul>
</li>
<li><a class="reference internal" href="#advanced">Advanced</a><ul>
<li><a class="reference internal" href="#pro-python">Pro Python</a></li>
<li><a class="reference internal" href="#expert-python-programming">Expert Python Programming</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="community.html" title="previous chapter">The Community</a></li>
<li>Next: <a href="documentation.html" title="next chapter">Documentation</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/intro/learning.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-170
View File
@@ -1,170 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>News &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Contribute" href="../notes/contribute.html" />
<link rel="prev" title="Documentation" href="documentation.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../notes/contribute.html" title="Contribute"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="documentation.html" title="Documentation"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="news">
<h1>News<a class="headerlink" href="#news" title="Permalink to this headline"></a></h1>
<div class="section" id="planet-python">
<h2>Planet Python<a class="headerlink" href="#planet-python" title="Permalink to this headline"></a></h2>
<p>This is an aggregate of Python news from a growing number of developers.</p>
<blockquote>
<div><a class="reference external" href="http://planet.python.org">Planet Python</a></div></blockquote>
</div>
<div class="section" id="r-python">
<h2>/r/python<a class="headerlink" href="#r-python" title="Permalink to this headline"></a></h2>
<p>/r/python is the Reddit Python community where users contribute and vote on
Python-related news.</p>
<blockquote>
<div><a class="reference external" href="http://reddit.com/r/python">/r/python</a></div></blockquote>
</div>
<div class="section" id="python-weekly">
<h2>Python Weekly<a class="headerlink" href="#python-weekly" title="Permalink to this headline"></a></h2>
<p>Python Weekly is a free weekly newsletter featuring curated news, articles,
new releases, jobs, etc. related to Python.</p>
<blockquote>
<div><a class="reference external" href="http://www.pythonweekly.com/">Python Weekly</a></div></blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">News</a><ul>
<li><a class="reference internal" href="#planet-python">Planet Python</a></li>
<li><a class="reference internal" href="#r-python">/r/python</a></li>
<li><a class="reference internal" href="#python-weekly">Python Weekly</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="documentation.html" title="previous chapter">Documentation</a></li>
<li>Next: <a href="../notes/contribute.html" title="next chapter">Contribute</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/intro/news.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-272
View File
@@ -1,272 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contribute &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="License" href="license.html" />
<link rel="prev" title="News" href="../intro/news.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="license.html" title="License"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../intro/news.html" title="News"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="contribute">
<h1>Contribute<a class="headerlink" href="#contribute" title="Permalink to this headline"></a></h1>
<p>Python-guide is under active development, and contributors are welcome.</p>
<p>If you have a feature request, suggestion, or bug report, please open a new
issue on <a class="reference external" href="http://github.com/kennethreitz/python-guide/">GitHub</a>. To submit patches, please send a pull request on <a class="reference external" href="http://github.com/kennethreitz/python-guide/">GitHub</a>.
Once your changes get merged back in, you&#8217;ll automatically be added to the
<a class="reference external" href="https://github.com/kennethreitz/python-guide/contributors">Contributors List</a>.</p>
<div class="section" id="style-guide">
<h2>Style Guide<a class="headerlink" href="#style-guide" title="Permalink to this headline"></a></h2>
<p>For all contributions, please follow the <a class="reference internal" href="styleguide.html#guide-style-guide"><em>The Guide Style Guide</em></a>.</p>
</div>
<div class="section" id="todo-list">
<span id="todo-list-ref"></span><h2>Todo List<a class="headerlink" href="#todo-list" title="Permalink to this headline"></a></h2>
<p>If you&#8217;d like to contribute, there&#8217;s plenty to do. Here&#8217;s a short <a class="reference external" href="https://github.com/kennethreitz/python-guide/blob/master/TODO.rst">todo</a> list.</p>
<blockquote>
<div><ul class="simple">
<li>Establish &#8220;use this&#8221; vs &#8220;alternatives are....&#8221; recommendations</li>
</ul>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">add supertab notes</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../dev/env.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/dev/env.rst, line 58.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">write a general blurb introducing the Python language</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../intro/duction.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/intro/duction.rst, line 4.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about <a class="reference external" href="http://propython.com/">Pro Python</a></p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../intro/learning.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/intro/learning.rst, line 62.)</p>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about <a class="reference external" href="http://www.packtpub.com/expert-python-programming/book">Expert Python Programming</a></p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../intro/learning.html#index-1"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/intro/learning.rst, line 67.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Determine License</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="license.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/notes/license.rst, line 4.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Chef</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/admin.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/admin.rst, line 72.)</p>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Puppet</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/admin.html#index-1"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/admin.rst, line 77.)</p>
<div class="admonition-todo admonition" id="index-2">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Blueprint</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/admin.html#index-2"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/admin.rst, line 82.)</p>
<div class="admonition-todo admonition" id="index-3">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Buildout</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/admin.html#index-3"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/admin.rst, line 87.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Mule</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/ci.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/ci.rst, line 27.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain &#8220;Command Line Applications&#8221;</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/cli.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/cli.rst, line 4.)</p>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Clint</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/cli.html#index-1"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/cli.rst, line 9.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain Django ORM</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/db.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/db.rst, line 28.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">write about matplotlib.</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/scientific.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/scientific.rst, line 43.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain Pyramid</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../scenarios/web.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/scenarios/web.rst, line 78.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;Freezing Your Code&#8221; stub</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../shipping/freezing.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/shipping/freezing.rst, line 14.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write introduction for &#8220;Packaging Your Code&#8221;</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../shipping/packaging.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/shipping/packaging.rst, line 6.)</p>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;For Linux Distributions&#8221; packaging stub</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../shipping/packaging.html#index-1"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/shipping/packaging.rst, line 63.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write &#8220;Building From Source&#8221;</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../starting/installation.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/starting/installation.rst, line 40.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in License stub</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../writing/license.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/writing/license.rst, line 7.)</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;Structuring Your Project&#8221; stub</p>
</div>
<p class="todo-source">(The <a class="reference internal" href="../writing/structure.html#index-0"><em>original entry</em></a> is located in /Users/kreitz/repos/public/python-guide/docs/writing/structure.rst, line 6.)</p>
</div></blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Contribute</a><ul>
<li><a class="reference internal" href="#style-guide">Style Guide</a></li>
<li><a class="reference internal" href="#todo-list">Todo List</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../intro/news.html" title="previous chapter">News</a></li>
<li>Next: <a href="license.html" title="next chapter">License</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/notes/contribute.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-144
View File
@@ -1,144 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>License &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="The Guide Style Guide" href="styleguide.html" />
<link rel="prev" title="Contribute" href="contribute.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="styleguide.html" title="The Guide Style Guide"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="contribute.html" title="Contribute"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="license">
<h1>License<a class="headerlink" href="#license" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Determine License</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p><h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="contribute.html" title="previous chapter">Contribute</a></li>
<li>Next: <a href="styleguide.html" title="next chapter">The Guide Style Guide</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/notes/license.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-288
View File
@@ -1,288 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Guide Style Guide &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="prev" title="License" href="license.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="license.html" title="License"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-guide-style-guide">
<span id="guide-style-guide"></span><h1>The Guide Style Guide<a class="headerlink" href="#the-guide-style-guide" title="Permalink to this headline"></a></h1>
<p>As with all documentation, having a consistent formating helps make the
document more understandable. In order to make The Guide easier to digest,
all contributions should fit within the rules of this style guide where
approriate.</p>
<p>The Guide is written as <a class="reference internal" href="../writing/documentation.html#restructuredtext-ref"><em>reStructuredText</em></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Parts of The Guide may not yet match this style guide. Feel free
to update those parts to by in sync with The Guide Style Guide</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">On any page of the rendered HTML you can click &#8220;Show Source&#8221; to
see how authors have styled the page.</p>
</div>
<div class="section" id="relevancy">
<h2>Relevancy<a class="headerlink" href="#relevancy" title="Permalink to this headline"></a></h2>
<p>Stride to keep any contributions relevant to the <a class="reference internal" href="../intro/duction.html#about-ref"><em>purpose of The Guide</em></a>.</p>
<ul class="simple">
<li>Avoid including too much information on subjects that don&#8217;t directly
relate to Python development.</li>
<li>Prefer to link to other sources if the information is already out there.
Be sure to describe what and why you are linking.</li>
<li><a class="reference external" href="http://sphinx.pocoo.org/rest.html?highlight=citations#citations">Cite</a>
references where needed.</li>
<li>If a subject isn&#8217;t directly relevant to Python, but useful in conjuction
with Python (ex: Git, Github, Databases), reference by linking to useful
resouces and describe why it&#8217;s useful to Python.</li>
<li>When in doubt, ask.</li>
</ul>
</div>
<div class="section" id="headings">
<h2>Headings<a class="headerlink" href="#headings" title="Permalink to this headline"></a></h2>
<p>Use the following styles for headings.</p>
<p>Chapter title:</p>
<div class="highlight-python"><pre>#########
Chapter 1
#########</pre>
</div>
<p>Page title:</p>
<div class="highlight-python"><pre>===================
Time is an Illusion
===================</pre>
</div>
<p>Section headings:</p>
<div class="highlight-python"><pre>Lunchtime Doubly So
-------------------</pre>
</div>
<p>Sub section headings:</p>
<div class="highlight-python"><pre>Very Deep
~~~~~~~~~</pre>
</div>
</div>
<div class="section" id="prose">
<h2>Prose<a class="headerlink" href="#prose" title="Permalink to this headline"></a></h2>
<p>Wrap text lines at 78 characters. Where necessary, lines may exceed 78
characters, especially if wrapping would make the source text more difficult
to read.</p>
</div>
<div class="section" id="code-examples">
<h2>Code Examples<a class="headerlink" href="#code-examples" title="Permalink to this headline"></a></h2>
<p>Wrap all code examples at 70 characters to avoid horizontal scrollbars.</p>
<p>Command line examples:</p>
<div class="highlight-python"><pre>.. code-block:: console
$ run command --help
$ ls ..</pre>
</div>
<p>Be sure to include the <tt class="docutils literal"><span class="pre">$</span></tt> prefix before each line.</p>
<p>Python interpreter examples:</p>
<div class="highlight-python"><pre>Label the example::
.. code-block:: python
&gt;&gt;&gt; import this</pre>
</div>
<p>Python examples:</p>
<div class="highlight-python"><pre>Descriptive title::
.. code-block:: python
def get_answer():
return 42</pre>
</div>
</div>
<div class="section" id="externally-linking">
<h2>Externally Linking<a class="headerlink" href="#externally-linking" title="Permalink to this headline"></a></h2>
<ul>
<li><p class="first">Prefer labels for well known subjects (ex: proper nouns) when linking:</p>
<div class="highlight-python"><pre>Sphinx_ is used to document Python.
.. _Sphinx: http://sphinx.pocoo.org</pre>
</div>
</li>
<li><p class="first">Prefer to use descriptive labels with inline links instead of leaving bare
links:</p>
<div class="highlight-python"><pre>Read the `Sphinx Tutorial &lt;http://sphinx.pocoo.org/tutorial.html&gt;`_</pre>
</div>
</li>
<li><p class="first">Avoid using labels such as &#8220;click here&#8221;, &#8220;this&#8221;, etc. preferring
decriptive labels (SEO worthy) instead.</p>
</li>
</ul>
</div>
<div class="section" id="linking-to-sections-in-the-guide">
<h2>Linking to Sections in The Guide<a class="headerlink" href="#linking-to-sections-in-the-guide" title="Permalink to this headline"></a></h2>
<p>To cross-reference other parts of this documentation, use the <a class="reference external" href="http://sphinx.pocoo.org/markup/inline.html#cross-referencing-arbitrary-locations">:ref:</a>
keyword and labels.</p>
<p>To make reference labels more clear and unique, always add a <tt class="docutils literal"><span class="pre">-ref</span></tt> suffix:</p>
<div class="highlight-python"><pre>.. _some-section-ref:
Some Section
------------</pre>
</div>
</div>
<div class="section" id="notes-and-warnings">
<h2>Notes and Warnings<a class="headerlink" href="#notes-and-warnings" title="Permalink to this headline"></a></h2>
<p>Make use of the appropriate <a class="reference external" href="http://sphinx.pocoo.org/rest.html#directives">admonitions directives</a> when making notes.</p>
<p>Notes:</p>
<div class="highlight-python"><pre>.. note::
The Hitchhikers Guide to the Galaxy has a few things to say
on the subject of towels. A towel, it says, is about the most
massively useful thing an interstellar hitch hiker can have.</pre>
</div>
<p>Warnings:</p>
<div class="highlight-python"><pre>.. warning:: DON'T PANIC</pre>
</div>
</div>
<div class="section" id="todos">
<h2>TODOs<a class="headerlink" href="#todos" title="Permalink to this headline"></a></h2>
<p>Please mark any incomplete areas of The Guide with a <a class="reference external" href="http://sphinx.pocoo.org/ext/todo.html?highlight=todo#directive-todo">todo directive</a>. To
avoid cluttering the <a class="reference internal" href="contribute.html#todo-list-ref"><em>Todo List</em></a>, use a single <tt class="docutils literal"><span class="pre">todo</span></tt> for stub
documents or large incomplete sections.</p>
<div class="highlight-python"><pre>.. todo::
Learn the Ultimate Answer to the Ultimate Question
of Life, The Universe, and Everything</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The Guide Style Guide</a><ul>
<li><a class="reference internal" href="#relevancy">Relevancy</a></li>
<li><a class="reference internal" href="#headings">Headings</a></li>
<li><a class="reference internal" href="#prose">Prose</a></li>
<li><a class="reference internal" href="#code-examples">Code Examples</a></li>
<li><a class="reference internal" href="#externally-linking">Externally Linking</a></li>
<li><a class="reference internal" href="#linking-to-sections-in-the-guide">Linking to Sections in The Guide</a></li>
<li><a class="reference internal" href="#notes-and-warnings">Notes and Warnings</a></li>
<li><a class="reference internal" href="#todos">TODOs</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="license.html" title="previous chapter">License</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/notes/styleguide.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-235
View File
@@ -1,235 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Systems Administration &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Continuous Integration" href="ci.html" />
<link rel="prev" title="Databases" href="db.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="ci.html" title="Continuous Integration"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="db.html" title="Databases"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="systems-administration">
<h1>Systems Administration<a class="headerlink" href="#systems-administration" title="Permalink to this headline"></a></h1>
<div class="section" id="fabric">
<h2>Fabric<a class="headerlink" href="#fabric" title="Permalink to this headline"></a></h2>
<p>Fabric is a library for simplifying system administration tasks. While Chef
and Puppet tend to focus on managing servers and system libraries,
fabric is more focused on application level tasks such as deployment.</p>
<p>Install Fabric:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>pip install fabric
</pre></div>
</div>
<p>The following code will create two tasks that we can use: <tt class="docutils literal"><span class="pre">memory_usage</span></tt> and
<tt class="docutils literal"><span class="pre">deploy</span></tt>. The former will output the memory usage on each machine. The
latter will ssh into each server, cd to our project directory, activate the
virtual environment, pull the newest codebase, and restart the application
server.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">fabric.api</span> <span class="kn">import</span> <span class="n">cd</span><span class="p">,</span> <span class="n">env</span><span class="p">,</span> <span class="n">prefix</span><span class="p">,</span> <span class="n">run</span><span class="p">,</span> <span class="n">task</span>
<span class="n">env</span><span class="o">.</span><span class="n">hosts</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;my_server1&#39;</span><span class="p">,</span> <span class="s">&#39;my_server2&#39;</span><span class="p">]</span>
<span class="nd">@task</span>
<span class="k">def</span> <span class="nf">memory_usage</span><span class="p">():</span>
<span class="n">run</span><span class="p">(</span><span class="s">&#39;free -m&#39;</span><span class="p">)</span>
<span class="nd">@task</span>
<span class="k">def</span> <span class="nf">deploy</span><span class="p">():</span>
<span class="k">with</span> <span class="n">cd</span><span class="p">(</span><span class="s">&#39;/var/www/project-env/project&#39;</span><span class="p">):</span>
<span class="k">with</span> <span class="n">prefix</span><span class="p">(</span><span class="s">&#39;. ../bin/activate&#39;</span><span class="p">):</span>
<span class="n">run</span><span class="p">(</span><span class="s">&#39;git pull&#39;</span><span class="p">)</span>
<span class="n">run</span><span class="p">(</span><span class="s">&#39;touch app.wsgi&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>With the previous code saved in a file named fabfile.py, we can check memory
usage with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>fab memory_usage
<span class="o">[</span>my_server1<span class="o">]</span> Executing task <span class="s1">&#39;memory&#39;</span>
<span class="o">[</span>my_server1<span class="o">]</span> run: free -m
<span class="o">[</span>my_server1<span class="o">]</span> out: total used free shared buffers cached
<span class="o">[</span>my_server1<span class="o">]</span> out: Mem: 6964 1897 5067 0 166 222
<span class="o">[</span>my_server1<span class="o">]</span> out: -/+ buffers/cache: 1509 5455
<span class="o">[</span>my_server1<span class="o">]</span> out: Swap: 0 0 0
<span class="o">[</span>my_server2<span class="o">]</span> Executing task <span class="s1">&#39;memory&#39;</span>
<span class="o">[</span>my_server2<span class="o">]</span> run: free -m
<span class="o">[</span>my_server2<span class="o">]</span> out: total used free shared buffers cached
<span class="o">[</span>my_server2<span class="o">]</span> out: Mem: 1666 902 764 0 180 572
<span class="o">[</span>my_server2<span class="o">]</span> out: -/+ buffers/cache: 148 1517
<span class="o">[</span>my_server2<span class="o">]</span> out: Swap: 895 1 894
</pre></div>
</div>
<p>and we can deploy with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>fab deploy
</pre></div>
</div>
<p>Additional features include parallel execution, interaction with remote
programs, and host grouping.</p>
</div>
<div class="section" id="chef">
<h2>Chef<a class="headerlink" href="#chef" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Chef</p>
</div>
</div>
<div class="section" id="puppet">
<h2>Puppet<a class="headerlink" href="#puppet" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Puppet</p>
</div>
</div>
<div class="section" id="blueprint">
<h2>Blueprint<a class="headerlink" href="#blueprint" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-2">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Blueprint</p>
</div>
</div>
<div class="section" id="buildout">
<h2>Buildout<a class="headerlink" href="#buildout" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-3">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Buildout</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Systems Administration</a><ul>
<li><a class="reference internal" href="#fabric">Fabric</a></li>
<li><a class="reference internal" href="#chef">Chef</a></li>
<li><a class="reference internal" href="#puppet">Puppet</a></li>
<li><a class="reference internal" href="#blueprint">Blueprint</a></li>
<li><a class="reference internal" href="#buildout">Buildout</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="db.html" title="previous chapter">Databases</a></li>
<li>Next: <a href="ci.html" title="next chapter">Continuous Integration</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/admin.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-183
View File
@@ -1,183 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Continuous Integration &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Speed" href="speed.html" />
<link rel="prev" title="Systems Administration" href="admin.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="speed.html" title="Speed"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="admin.html" title="Systems Administration"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="continuous-integration">
<h1>Continuous Integration<a class="headerlink" href="#continuous-integration" title="Permalink to this headline"></a></h1>
<div class="section" id="why">
<h2>Why?<a class="headerlink" href="#why" title="Permalink to this headline"></a></h2>
<p>Martin Fowler, who first wrote about <a class="reference external" href="http://martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a> (short: CI) together with Kent Beck, describes the CI as follows:</p>
<blockquote>
<div>Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.</div></blockquote>
</div>
<div class="section" id="jenkins">
<h2>Jenkins<a class="headerlink" href="#jenkins" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://jenkins-ci.org">Jenkins CI</a> is an extensible continuous integration engine. Use it.</p>
</div>
<div class="section" id="buildbot">
<h2>Buildbot<a class="headerlink" href="#buildbot" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://buildbot.net/buildbot/docs/current">Buildbot</a> is a Python system to automate the compile/test cycle to validate code changes.</p>
</div>
<div class="section" id="mule">
<h2>Mule?<a class="headerlink" href="#mule" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Mule</p>
</div>
</div>
<div class="section" id="tox">
<h2>Tox<a class="headerlink" href="#tox" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="https://bitbucket.org/hpk42/tox">tox</a> is an automation tool providing packaging, testing and deployment of Python software right from the console or CI server.
It is a generic virtualenv management and test command line tool which provides the following features:</p>
<ul class="simple">
<li>Checking that packages install correctly with different Python versions and interpreters</li>
<li>Running tests in each of the environments, configuring your test tool of choice</li>
<li>Acting as a frontend to Continuous Integration servers, reducing boilerplate and merging CI and shell-based testing.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Continuous Integration</a><ul>
<li><a class="reference internal" href="#why">Why?</a></li>
<li><a class="reference internal" href="#jenkins">Jenkins</a></li>
<li><a class="reference internal" href="#buildbot">Buildbot</a></li>
<li><a class="reference internal" href="#mule">Mule?</a></li>
<li><a class="reference internal" href="#tox">Tox</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="admin.html" title="previous chapter">Systems Administration</a></li>
<li>Next: <a href="speed.html" title="next chapter">Speed</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/ci.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-159
View File
@@ -1,159 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Command Line Applications &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="GUI Applications" href="gui.html" />
<link rel="prev" title="Web Applications" href="web.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="gui.html" title="GUI Applications"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="web.html" title="Web Applications"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="command-line-applications">
<h1>Command Line Applications<a class="headerlink" href="#command-line-applications" title="Permalink to this headline"></a></h1>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain &#8220;Command Line Applications&#8221;</p>
</div>
<div class="section" id="clint">
<h2>Clint<a class="headerlink" href="#clint" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Write about Clint</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Command Line Applications</a><ul>
<li><a class="reference internal" href="#clint">Clint</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="web.html" title="previous chapter">Web Applications</a></li>
<li>Next: <a href="gui.html" title="next chapter">GUI Applications</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/cli.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-172
View File
@@ -1,172 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Databases &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Systems Administration" href="admin.html" />
<link rel="prev" title="GUI Applications" href="gui.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="admin.html" title="Systems Administration"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="gui.html" title="GUI Applications"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="databases">
<h1>Databases<a class="headerlink" href="#databases" title="Permalink to this headline"></a></h1>
<div class="section" id="db-api">
<h2>DB-API<a class="headerlink" href="#db-api" title="Permalink to this headline"></a></h2>
<p>The Python Database API (DB-API) defines a standard interface for Python
database access modules. It&#8217;s documented in <a class="reference external" href="http://www.python.org/dev/peps/pep-0249/">PEP 249</a>.
Nearly all Python database modules such as <cite>sqlite3</cite>, <cite>psycopg</cite> and
<cite>mysql-python</cite> conform to this interface.</p>
</div>
<div class="section" id="sqlalchemy">
<h2>SQLAlchemy<a class="headerlink" href="#sqlalchemy" title="Permalink to this headline"></a></h2>
<p><a class="reference external" href="http://www.sqlalchemy.org/">SQLAlchemy</a> is a commonly used database toolkit. Unlike many database libraries
it not only provides an ORM layer but also a generalized API for writing
database-agnostic code without SQL.</p>
<div class="highlight-python"><pre>pip install sqlalchemy</pre>
</div>
</div>
<div class="section" id="django-orm">
<h2>Django ORM<a class="headerlink" href="#django-orm" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain Django ORM</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Databases</a><ul>
<li><a class="reference internal" href="#db-api">DB-API</a></li>
<li><a class="reference internal" href="#sqlalchemy">SQLAlchemy</a></li>
<li><a class="reference internal" href="#django-orm">Django ORM</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="gui.html" title="previous chapter">GUI Applications</a></li>
<li>Next: <a href="admin.html" title="next chapter">Systems Administration</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/db.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-219
View File
@@ -1,219 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GUI Applications &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Databases" href="db.html" />
<link rel="prev" title="Command Line Applications" href="cli.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="db.html" title="Databases"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="cli.html" title="Command Line Applications"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="gui-applications">
<h1>GUI Applications<a class="headerlink" href="#gui-applications" title="Permalink to this headline"></a></h1>
<div class="section" id="qt">
<h2>Qt<a class="headerlink" href="#qt" title="Permalink to this headline"></a></h2>
<p>Qt is a cross-platform application framework that is widely used for developing software with a GUI but can also be used for non-GUI applications.</p>
<div class="section" id="pyside">
<h3>PySide<a class="headerlink" href="#pyside" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://developer.qt.nokia.com/wiki/PySideDownloads/">http://developer.qt.nokia.com/wiki/PySideDownloads/</a></p>
</div>
<div class="section" id="pyqt">
<h3>PyQt<a class="headerlink" href="#pyqt" title="Permalink to this headline"></a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If your software does not fully comply with the GPL you will need a commercial license!</p>
</div>
<p><a class="reference external" href="http://www.riverbankcomputing.co.uk/software/pyqt/download">http://www.riverbankcomputing.co.uk/software/pyqt/download</a></p>
</div>
</div>
<div class="section" id="cocoa">
<h2>Cocoa<a class="headerlink" href="#cocoa" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The Cocoa framework is only available on Mac OSX. Don&#8217;t pick this if you&#8217;re writing a cross-platform application!</p>
</div>
<div class="section" id="pyobjc">
<h3>PyObjC<a class="headerlink" href="#pyobjc" title="Permalink to this headline"></a></h3>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Only available on Mac OSX. Don&#8217;t pick this if you&#8217;re writing a cross-platform application.</p>
</div>
</div>
</div>
<div class="section" id="wxpython">
<h2>WXPython<a class="headerlink" href="#wxpython" title="Permalink to this headline"></a></h2>
<div class="section" id="install-stable">
<h3>Install (Stable)<a class="headerlink" href="#install-stable" title="Permalink to this headline"></a></h3>
<p><em>Go to http://www.wxpython.org/download.php#stable and download the appropriate package for your OS.</em></p>
</div>
</div>
<div class="section" id="gtk">
<h2>Gtk<a class="headerlink" href="#gtk" title="Permalink to this headline"></a></h2>
<p>PyGTK provides Python bindings for the GTK+ toolkit. Like the GTK+ library
itself, it is currently licensed under the GNU LGPL. It is worth noting that
PyGTK only currenty supports the Gtk-2.X API (NOT Gtk-3.0). It is currently
recommended that PyGTK is not used for new projects and existing applications be
ported from PyGTK to PyGObject.</p>
</div>
<div class="section" id="tk">
<h2>Tk<a class="headerlink" href="#tk" title="Permalink to this headline"></a></h2>
<p>Tkinter is a thin object-oriented layer on top of Tcl/Tk. It has the advantage
of being included with the Python standard library, making it the most
convenient and compatible toolkit to program with.</p>
<p>Both Tk and Tkinter are available on most Unix platforms, as well as on Windows
and Macintosh systems. Starting with the 8.0 release, Tk offers native look and
feel on all platforms.</p>
<p>There&#8217;s a good multi-language Tk tutorial with Python examples at
<a class="reference external" href="http://www.tkdocs.com/tutorial/index.html">TkDocs</a>. There&#8217;s more information
available on the <a class="reference external" href="http://wiki.python.org/moin/TkInter">Python Wiki</a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">GUI Applications</a><ul>
<li><a class="reference internal" href="#qt">Qt</a><ul>
<li><a class="reference internal" href="#pyside">PySide</a></li>
<li><a class="reference internal" href="#pyqt">PyQt</a></li>
</ul>
</li>
<li><a class="reference internal" href="#cocoa">Cocoa</a><ul>
<li><a class="reference internal" href="#pyobjc">PyObjC</a></li>
</ul>
</li>
<li><a class="reference internal" href="#wxpython">WXPython</a><ul>
<li><a class="reference internal" href="#install-stable">Install (Stable)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#gtk">Gtk</a></li>
<li><a class="reference internal" href="#tk">Tk</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="cli.html" title="previous chapter">Command Line Applications</a></li>
<li>Next: <a href="db.html" title="next chapter">Databases</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/gui.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-198
View File
@@ -1,198 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Scientific Applications &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Packaging Your Code" href="../shipping/packaging.html" />
<link rel="prev" title="Speed" href="speed.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../shipping/packaging.html" title="Packaging Your Code"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="speed.html" title="Speed"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="scientific-applications">
<h1>Scientific Applications<a class="headerlink" href="#scientific-applications" title="Permalink to this headline"></a></h1>
<div class="section" id="context">
<h2>Context<a class="headerlink" href="#context" title="Permalink to this headline"></a></h2>
<p>Python is frequently used for high-performance scientific applications. Python is widely used in academia
and scientific projects because it is easy to write, and it performs really well.</p>
<p>Due to its high performance nature, scientific computing in python often refers to external libraries, typically
written in faster languages (like C, or FORTRAN for matrix operations). The main libraries used are NumPy and SciPy</p>
</div>
<div class="section" id="libraries">
<h2>Libraries<a class="headerlink" href="#libraries" title="Permalink to this headline"></a></h2>
<div class="section" id="numpy">
<h3>Numpy<a class="headerlink" href="#numpy" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://numpy.scipy.org/">NumPy</a> is a low level library written in C (and FORTRAN) for high level mathematical functions.
NumPy cleverly overcomes the problem of running slower algorithms on Python by using multidimensional arrays and functions that operate on arrays.
Any algorithm can then be expressed as a function on arrays, allowing the algorithms to be run quickly.</p>
<p>NumPy is part of the SciPy project, and is released as a separate library so people who only need the basic requirements can just use NumPy.</p>
<p>NumPy is compatible with Python versions 2.4 through to 2.7.2 and 3.1+.</p>
</div>
<div class="section" id="scipy">
<h3>SciPy<a class="headerlink" href="#scipy" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://scipy.org/">SciPy</a> is a library that uses Numpy for more mathematical function. SciPy uses NumPy arrays as its basic data structure.
SciPy comes with modules for various commonly used tasks in scientific programing like linear algebra, integration (calculus),
ordinary differential equation solvers and signal processing.</p>
</div>
<div class="section" id="enthought">
<h3>Enthought<a class="headerlink" href="#enthought" title="Permalink to this headline"></a></h3>
<p>Installing NumPy and SciPy can be a daunting task. Which is why the <a class="reference external" href="http://enthought.com/">Enthought Python distribution</a> was created. With Enthought,
scientific python has never been easier (one click to install about 100 scientific python packages). User beware: Enthought is not free.</p>
</div>
<div class="section" id="matplotlib">
<h3>Matplotlib<a class="headerlink" href="#matplotlib" title="Permalink to this headline"></a></h3>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">write about matplotlib.</p>
</div>
</div>
</div>
<div class="section" id="resources">
<h2>Resources<a class="headerlink" href="#resources" title="Permalink to this headline"></a></h2>
<p>Many people who do scientific computing are on Windows. And yet many of the scientific computing packages are notoriously difficult to build and install.
<a class="reference external" href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">Christoph Gohlke</a> however, has compiled a list of Windows binaries for many useful Python packages.
The list of packages has grown from a mainly scientific python resource to a more general list. It might be a good idea to check it out if you&#8217;re on Windows.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Scientific Applications</a><ul>
<li><a class="reference internal" href="#context">Context</a></li>
<li><a class="reference internal" href="#libraries">Libraries</a><ul>
<li><a class="reference internal" href="#numpy">Numpy</a></li>
<li><a class="reference internal" href="#scipy">SciPy</a></li>
<li><a class="reference internal" href="#enthought">Enthought</a></li>
<li><a class="reference internal" href="#matplotlib">Matplotlib</a></li>
</ul>
</li>
<li><a class="reference internal" href="#resources">Resources</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="speed.html" title="previous chapter">Speed</a></li>
<li>Next: <a href="../shipping/packaging.html" title="next chapter">Packaging Your Code</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/scientific.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-232
View File
@@ -1,232 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Speed &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Scientific Applications" href="scientific.html" />
<link rel="prev" title="Continuous Integration" href="ci.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="scientific.html" title="Scientific Applications"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="ci.html" title="Continuous Integration"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="speed">
<h1>Speed<a class="headerlink" href="#speed" title="Permalink to this headline"></a></h1>
<p>CPython, the most commonly used implementation of Python, is slow for CPU bound tasks. <a class="reference external" href="http://pypy.org">PyPy</a> is fast.</p>
<p>Using a slightly modified version of <a class="reference external" href="http://www.dabeaz.com/GIL/gilvis/measure2.py">David Beazleys</a> CPU bound test code(added loop for multiple tests), you can see the difference between CPython and PyPy&#8217;s processing.</p>
<div class="highlight-python"><pre>PyPy
$ ./pypy -V
Python 2.7.1 (7773f8fc4223, Nov 18 2011, 18:47:10)
[PyPy 1.7.0 with GCC 4.4.3]
$ ./pypy measure2.py
0.0683999061584
0.0483210086823
0.0388588905334
0.0440690517426
0.0695300102234</pre>
</div>
<div class="highlight-python"><pre>CPython
$ ./python -V
Python 2.7.1
$ ./python measure2.py
1.06774401665
1.45412397385
1.51485204697
1.54693889618
1.60109114647</pre>
</div>
<div class="section" id="context">
<h2>Context<a class="headerlink" href="#context" title="Permalink to this headline"></a></h2>
<div class="section" id="the-gil">
<h3>The GIL<a class="headerlink" href="#the-gil" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://wiki.python.org/moin/GlobalInterpreterLock">The GIL</a> (Global Interpreter Lock) is how Python allows multiple threads to operate at the same time. Python&#8217;s
memory management isn&#8217;t entirely thread-safe, so the GIL is requried to prevents multiple threads from running
the same Python code at once.</p>
<p>David Beazley has a great <a class="reference external" href="http://www.dabeaz.com/python/UnderstandingGIL.pdf">guide</a> on how the GIL operates. He also covers the <a class="reference external" href="http://www.dabeaz.com/python/NewGIL.pdf">new GIL</a> in Python 3.2. His
results show that maximizing performance in a Python application requires a strong understanding of the GIL,
how it affects your specific application, how many cores you have, and where your application bottlenecks are.</p>
</div>
<div class="section" id="c-extentions">
<h3>C Extentions<a class="headerlink" href="#c-extentions" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="id1">
<h3>The GIL<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://docs.python.org/c-api/init.html#threads">Special care</a> must be taken when writing C extensions to make sure you register your threads
with the interpreter.</p>
</div>
</div>
<div class="section" id="id2">
<h2>C Extentions<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
<div class="section" id="cython">
<h3>Cython<a class="headerlink" href="#cython" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="pyrex">
<h3>Pyrex<a class="headerlink" href="#pyrex" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="shedskin">
<h3>Shedskin?<a class="headerlink" href="#shedskin" title="Permalink to this headline"></a></h3>
</div>
</div>
<div class="section" id="threading">
<h2>Threading<a class="headerlink" href="#threading" title="Permalink to this headline"></a></h2>
<div class="section" id="id3">
<h3>Threading<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="spanwing-processes">
<h3>Spanwing Processes<a class="headerlink" href="#spanwing-processes" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="multiprocessing">
<h3>Multiprocessing<a class="headerlink" href="#multiprocessing" title="Permalink to this headline"></a></h3>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Speed</a><ul>
<li><a class="reference internal" href="#context">Context</a><ul>
<li><a class="reference internal" href="#the-gil">The GIL</a></li>
<li><a class="reference internal" href="#c-extentions">C Extentions</a></li>
<li><a class="reference internal" href="#id1">The GIL</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id2">C Extentions</a><ul>
<li><a class="reference internal" href="#cython">Cython</a></li>
<li><a class="reference internal" href="#pyrex">Pyrex</a></li>
<li><a class="reference internal" href="#shedskin">Shedskin?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#threading">Threading</a><ul>
<li><a class="reference internal" href="#id3">Threading</a></li>
<li><a class="reference internal" href="#spanwing-processes">Spanwing Processes</a></li>
<li><a class="reference internal" href="#multiprocessing">Multiprocessing</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="ci.html" title="previous chapter">Continuous Integration</a></li>
<li>Next: <a href="scientific.html" title="next chapter">Scientific Applications</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/speed.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-355
View File
@@ -1,355 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Applications &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Command Line Applications" href="cli.html" />
<link rel="prev" title="Choosing a License" href="../writing/license.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="cli.html" title="Command Line Applications"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../writing/license.html" title="Choosing a License"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="web-applications">
<h1>Web Applications<a class="headerlink" href="#web-applications" title="Permalink to this headline"></a></h1>
<div class="section" id="context">
<h2>Context<a class="headerlink" href="#context" title="Permalink to this headline"></a></h2>
<div class="section" id="wsgi">
<h3>WSGI<a class="headerlink" href="#wsgi" title="Permalink to this headline"></a></h3>
<p>The Web Server Gateway Interface (or &#8220;WSGI&#8221; for short) is a standard
interface between web servers and Python web application frameworks. By
standardizing behavior and communication between web servers and Python web
frameworks, WSGI makes it possible to write portable Python web code that
can be deployed in any <a class="reference internal" href="#wsgi-servers-ref"><em>WSGI-compliant web server</em></a>. WSGI is
documented in <a class="reference external" href="http://www.python.org/dev/peps/pep-3333/">PEP-3333</a>.</p>
</div>
</div>
<div class="section" id="frameworks">
<h2>Frameworks<a class="headerlink" href="#frameworks" title="Permalink to this headline"></a></h2>
<p>Broadly speaking, a web framework is a set of libraries upon which you can
build custom code to implement a web application (i.e. an interactive web
site). Most web frameworks include patterns and utilities to accomplish at
least the following:</p>
<dl class="docutils">
<dt>URL Routing</dt>
<dd>Matches an incoming HTTP request to a particular piece of Python code to
be invoked</dd>
<dt>Request and Response Objects</dt>
<dd>Encapsulate the information received from or sent to a user&#8217;s browser</dd>
<dt>Template Engine</dt>
<dd>Allows for separating Python code implementing an application&#8217;s logic from
the HTML (or other) output that it produces</dd>
<dt>Development Web Server</dt>
<dd>Runs an HTTP server on development machines to enable rapid development;
often automatically reloads server-side code when files are updated</dd>
</dl>
<div class="section" id="django">
<h3>Django<a class="headerlink" href="#django" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.djangoproject.com">Django</a> is a &#8220;batteries included&#8221; web
application framework. By providing many utilities and patterns out of the
box, Django aims to make it possible to build complex, database-backed web
applications quickly, while encouraging best practices in code written using
it.</p>
<p>Django has a large and active community, and many pre-built <a class="reference external" href="http://djangopackages.com/">re-usable
modules</a> that can be incorporated into a new
project as-is, or customized to fit your needs.</p>
<p>There are annual Django conferences <a class="reference external" href="http://djangocon.us">in the United States</a> and <a class="reference external" href="http://djangocon.eu">in Europe</a>.</p>
</div>
<div class="section" id="flask">
<h3>Flask<a class="headerlink" href="#flask" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://flask.pocoo.org/">Flask</a> is a &#8220;microframework&#8221; for Python. Rather
than aiming to provide everything you could possibly need, Flask implements
the most commonly-used core components of a web application framework, like
URL routing, request and response objects, and templates. As a user of
Flask, it is therefore up to you to choose and integrate other components
you may need, such as database access or form generation and validation. For
many popular modules, <a class="reference external" href="http://flask.pocoo.org/extensions/">Extensions</a> may
already exist to suit your needs.</p>
<p><strong>Support</strong> for flask can best be found in its mailing list. Just shoot an email to
<a class="reference external" href="mailto:flask&#37;&#52;&#48;librelist&#46;com">flask<span>&#64;</span>librelist<span>&#46;</span>com</a> and reply to the confirmation email.</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Explain Pyramid</p>
</div>
</div>
</div>
<div class="section" id="web-servers">
<h2>Web Servers<a class="headerlink" href="#web-servers" title="Permalink to this headline"></a></h2>
<div class="section" id="nginx">
<span id="nginx-ref"></span><h3>Nginx<a class="headerlink" href="#nginx" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://nginx.org/">Nginx</a> (pronounced &#8220;engine-x&#8221;) is a web server and
reverse-proxy for HTTP, SMTP and other protocols. It is known for its
high performance, relative simplicity, and compatibility with many
application servers (like WSGI servers). It also includes handy features
like load-balancing, basic authentication, streaming, and others. Designed
to serve high-load websites, Nginx is gradually becoming quite popular.</p>
</div>
</div>
<div class="section" id="wsgi-servers">
<span id="wsgi-servers-ref"></span><h2>WSGI Servers<a class="headerlink" href="#wsgi-servers" title="Permalink to this headline"></a></h2>
<p>Stand-alone WSGI servers typically use less resources than traditional web
servers and provide top performance <a class="footnote-reference" href="#id13" id="id4">[3]</a>.</p>
<div class="section" id="gunicorn">
<span id="gunicorn-ref"></span><h3>Gunicorn<a class="headerlink" href="#gunicorn" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://gunicorn.org/">Gunicorn</a> (Green Unicorn) is a WSGI server used
to serve Python applications. It is a Python interpretation of the Ruby
<a class="reference external" href="http://unicorn.bogomips.org/">Unicorn</a> server. Unicorn is designed to be
lightweight, easy to use, and uses many UNIX idioms. Gunicorn is not designed
to face the internet, in fact it was designed to run behind Nginx which buffers
slow requests, and takes care of other important considerations. A sample
setup for Nginx + gUnicorn can be found in the
<a class="reference external" href="http://gunicorn.org/deploy.html">Gunicorn help</a>.</p>
</div>
</div>
<div class="section" id="server-best-practices">
<span id="uwsgi-ref"></span><h2>Server Best Practices<a class="headerlink" href="#server-best-practices" title="Permalink to this headline"></a></h2>
<p>The majority of self hosted Python applications today are hosted with a WSGI
server such as <a class="reference internal" href="#gunicorn-ref"><em>gUnicorn</em></a>, either directly or behind a
lightweight web server such as <a class="reference internal" href="#nginx-ref"><em>nginx</em></a>.</p>
<p>The WSGI servers serve the Python applications while the web server handles tasks
better suited for it such as static file serving, request routing, DDoS
protection, and basic authentication.</p>
</div>
<div class="section" id="hosting">
<h2>Hosting<a class="headerlink" href="#hosting" title="Permalink to this headline"></a></h2>
<div class="section" id="platform-as-a-service">
<h3>Platform-as-a-Service<a class="headerlink" href="#platform-as-a-service" title="Permalink to this headline"></a></h3>
<p>Platform-as-a-Service (PaaS) is a type of cloud computing infrastructure
which abstracts and manages infrastructure, routing, and scaling of web
applications. When using PaaS, application developers can focus on writing
application code rather than needing to be concerned with deployment
details.</p>
<p>Most PaaS services offer a command-line interface that developers can use to
set up and interrogate configuration, and to deploy new releases of an
application to the service.</p>
<p>PaaS services and their partners offer add-on functionality which is well
integrated into the platform, such as database hosting, email services,
logging, scheduled and background tasks, billing and payment, etc.</p>
<div class="section" id="heroku">
<h4>Heroku<a class="headerlink" href="#heroku" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="http://www.heroku.com/">Heroku</a>&#8216;s
<a class="reference external" href="http://devcenter.heroku.com/articles/cedar">Cedar stack</a> offers first class
support for Python 2.7 applications.</p>
<p>Heroku allows you to run as many Python web applications as you like, 24/7 and free
of charge. Heroku is best described as a horizontal scaling platform. They start
to charge you once you &#8220;scale&#8221; you application to run on more than one Dyno
(abstacted servers) at a time.</p>
<p>Heroku publishes <a class="reference external" href="http://devcenter.heroku.com/articles/python">step-by-step instructions</a> on how to set up your first
application for use in Heroku, and maintains a list of <a class="reference external" href="http://python.herokuapp.com/">example applications</a>.</p>
</div>
<div class="section" id="dotcloud">
<h4>DotCloud<a class="headerlink" href="#dotcloud" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="http://www.dotcloud.com/">DotCloud</a> supports WSGI applications and
background/worker tasks natively on their platform. Web applications running
Python version 2.6, and uses <a class="reference internal" href="#nginx-ref"><em>nginx</em></a> and <a class="reference internal" href="#uwsgi-ref"><em>uWSGI</em></a>, and allows custom configuration of both
for advanced users.</p>
<p>DotCloud uses a custom command-line API client which can work with
applications managed in git repositories or any other version control
system.</p>
<p>DotCloud has a free plan with limited database size, and without extra
services (caching…).</p>
<p>See the <a class="reference external" href="http://docs.dotcloud.com/services/python/">DotCloud documentation on Python</a> for more information and help
getting started.</p>
</div>
<div class="section" id="ep-io">
<h4>ep.io<a class="headerlink" href="#ep-io" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="https://www.ep.io/">ep.io</a> is a PaaS designed specifically for Python web
applications. It supports Python versions 2.6 and 2.7, and has Pythonic
integrations with a variety of services.</p>
<p>ep.io has a free plan with bandwidth and disk space limitations. Also, in the
free plan, the web process is only loaded when needed. This means that the
first request after some inactivity may take up to 15 seconds.</p>
<p>ep.io publishes <a class="reference external" href="https://www.ep.io/docs/quickstart/">step-by-step instructions</a> on how to get started with their
platform and how to deploy Django, Flask, or generic WSGI applications.</p>
<p>ep.io is currently in invite-only beta.</p>
</div>
<div class="section" id="gondor">
<h4>Gondor<a class="headerlink" href="#gondor" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="https://gondor.io/">Gondor</a> is a PaaS specailized for deploying Django
and Pinax applications. Gondor supports Django versions 1.2 and 1.3 on
Python version 2.7, and can automatically configure your Django site if you
use <tt class="docutils literal"><span class="pre">local_settings.py</span></tt> for site-specific configuration information.</p>
<p>Gondor publishes guides to deploying <a class="reference external" href="https://gondor.io/support/setting-up-django/">Django projects</a> and <a class="reference external" href="https://gondor.io/support/setting-up-pinax/">Pinax projects</a> on their platform.</p>
<p class="rubric">References</p>
<table class="docutils footnote" frame="void" id="id11" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><a class="reference external" href="http://blog.dscpl.com.au/2010/06/modpython-project-is-now-officially.html">The mod_python project is now officially dead</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id12" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[2]</td><td><a class="reference external" href="http://www.modpython.org/pipermail/mod_python/2007-July/024080.html">mod_wsgi vs mod_python</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id13" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[3]</a></td><td><a class="reference external" href="http://nichol.as/benchmark-of-python-web-servers">Benchmark of Python WSGI Servers</a></td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Web Applications</a><ul>
<li><a class="reference internal" href="#context">Context</a><ul>
<li><a class="reference internal" href="#wsgi">WSGI</a></li>
</ul>
</li>
<li><a class="reference internal" href="#frameworks">Frameworks</a><ul>
<li><a class="reference internal" href="#django">Django</a></li>
<li><a class="reference internal" href="#flask">Flask</a></li>
</ul>
</li>
<li><a class="reference internal" href="#web-servers">Web Servers</a><ul>
<li><a class="reference internal" href="#nginx">Nginx</a></li>
</ul>
</li>
<li><a class="reference internal" href="#wsgi-servers">WSGI Servers</a><ul>
<li><a class="reference internal" href="#gunicorn">Gunicorn</a></li>
</ul>
</li>
<li><a class="reference internal" href="#server-best-practices">Server Best Practices</a></li>
<li><a class="reference internal" href="#hosting">Hosting</a><ul>
<li><a class="reference internal" href="#platform-as-a-service">Platform-as-a-Service</a><ul>
<li><a class="reference internal" href="#heroku">Heroku</a></li>
<li><a class="reference internal" href="#dotcloud">DotCloud</a></li>
<li><a class="reference internal" href="#ep-io">ep.io</a></li>
<li><a class="reference internal" href="#gondor">Gondor</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../writing/license.html" title="previous chapter">Choosing a License</a></li>
<li>Next: <a href="cli.html" title="next chapter">Command Line Applications</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/scenarios/web.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
+27 -19
View File
@@ -80,9 +80,19 @@
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<div class="sphinxsidebarwrapper"><h1><a href="http://python-guide.org">Python Guide.</a></h1>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3>Donate</h3>
<p>
If you enjoy this guide, consider supporting the author <a href="https://www.gittip.com/kennethreitz/">on Gittip</a>:
</p>
<p>
<iframe style="border: 0; margin: 0; padding: 0;"
src="https://www.gittip.com/kennethreitz/widget.html"
width="48pt" height="20pt"></iframe>
</p><h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
@@ -93,29 +103,27 @@
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<a href="https://github.com/kennethreitz/conductofcode" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '50431947613f5d52d2000031');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
+1 -1
View File
File diff suppressed because one or more lines are too long
-197
View File
@@ -1,197 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Freezing Your Code &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Introduction" href="../intro/duction.html" />
<link rel="prev" title="Packaging Your Code" href="packaging.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../intro/duction.html" title="Introduction"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="packaging.html" title="Packaging Your Code"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="freezing-your-code">
<h1>Freezing Your Code<a class="headerlink" href="#freezing-your-code" title="Permalink to this headline"></a></h1>
<p>An alternative to shipping your code is freezing it — shipping it as an
executable with a bundled Python interpreter.</p>
<p>Many applications you use every day do this:</p>
<ul class="simple">
<li>Dropbox</li>
<li>BitTorrent</li>
<li></li>
</ul>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;Freezing Your Code&#8221; stub</p>
</div>
<div class="section" id="windows">
<h2>Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h2>
<div class="section" id="py2exe">
<h3>py2exe<a class="headerlink" href="#py2exe" title="Permalink to this headline"></a></h3>
</div>
</div>
<div class="section" id="osx">
<h2>OSX<a class="headerlink" href="#osx" title="Permalink to this headline"></a></h2>
<div class="section" id="py2app">
<h3>py2app<a class="headerlink" href="#py2app" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="pyinstaller">
<h3>PyInstaller<a class="headerlink" href="#pyinstaller" title="Permalink to this headline"></a></h3>
</div>
</div>
<div class="section" id="linux">
<h2>Linux<a class="headerlink" href="#linux" title="Permalink to this headline"></a></h2>
<div class="section" id="bbfreeze">
<h3>bbFreeze<a class="headerlink" href="#bbfreeze" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="id1">
<h3>PyInstaller<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Freezing Your Code</a><ul>
<li><a class="reference internal" href="#windows">Windows</a><ul>
<li><a class="reference internal" href="#py2exe">py2exe</a></li>
</ul>
</li>
<li><a class="reference internal" href="#osx">OSX</a><ul>
<li><a class="reference internal" href="#py2app">py2app</a></li>
<li><a class="reference internal" href="#pyinstaller">PyInstaller</a></li>
</ul>
</li>
<li><a class="reference internal" href="#linux">Linux</a><ul>
<li><a class="reference internal" href="#bbfreeze">bbFreeze</a></li>
<li><a class="reference internal" href="#id1">PyInstaller</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="packaging.html" title="previous chapter">Packaging Your Code</a></li>
<li>Next: <a href="../intro/duction.html" title="next chapter">Introduction</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/shipping/freezing.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-227
View File
@@ -1,227 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Packaging Your Code &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Freezing Your Code" href="freezing.html" />
<link rel="prev" title="Scientific Applications" href="../scenarios/scientific.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="freezing.html" title="Freezing Your Code"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../scenarios/scientific.html" title="Scientific Applications"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="packaging-your-code">
<h1>Packaging Your Code<a class="headerlink" href="#packaging-your-code" title="Permalink to this headline"></a></h1>
<p>Packaging your code is important.</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write introduction for &#8220;Packaging Your Code&#8221;</p>
</div>
<div class="section" id="for-python-developers">
<h2>For Python Developers<a class="headerlink" href="#for-python-developers" title="Permalink to this headline"></a></h2>
<p>If you&#8217;re writing an open source Python module, <a class="reference external" href="http://pypi.python.org">PyPI</a>, more properly known as <em>The Cheeseshop</em>, is the place to host it.</p>
<div class="section" id="pip-vs-easy-install">
<h3>Pip vs. easy_install<a class="headerlink" href="#pip-vs-easy-install" title="Permalink to this headline"></a></h3>
<p>Use <a class="reference external" href="http://pypi.python.org/pypi/pip">pip</a>. More details <a class="reference external" href="http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install">here</a></p>
</div>
<div class="section" id="personal-pypi">
<h3>Personal PyPI<a class="headerlink" href="#personal-pypi" title="Permalink to this headline"></a></h3>
<p>If you want to install packages from a source different from PyPI, (say, if
your packages are <em>proprietary</em>), you can do it by hosting a simple http server,
running from the directory which holds those packages which need to be installed.</p>
<p><strong>Showing an example is always beneficial</strong></p>
<p>Say if you are after installing a package called MyPackage.tar.gz, and assuming this is your directory structure</p>
<ul>
<li><dl class="first docutils">
<dt>archive</dt>
<dd><ul class="first last">
<li><dl class="first docutils">
<dt>MyPackage</dt>
<dd><ul class="first last simple">
<li>MyPackage.tar.gz</li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>Go to your command prompt and type:</p>
<div class="highlight-python"><pre>$ cd archive
$ python -m SimpleHTTPServer 9000</pre>
</div>
<p>This runs a simple http server running on port 9000 and will list all packages (like <strong>MyPackage</strong>). Now you can install <strong>MyPackage</strong> using any python package installer. Using Pip, you would do it like:</p>
<div class="highlight-python"><pre>$ pip install --extra-index-url=http://127.0.0.1:9000/ MyPackage</pre>
</div>
<p>Having a folder with the same name as the package name is <strong>crucial</strong> here.
I got fooled by that, one time. But if you feel that creating a folder called
<strong>MyPackage</strong> and keeping <strong>MyPackage.tar.gz</strong> inside that, is <em>redundant</em>, you can still install MyPackage using:</p>
<div class="highlight-python"><pre>$ pip install http://127.0.0.1:9000/MyPackage.tar.gz</pre>
</div>
<div class="section" id="chishop">
<h4>Chishop<a class="headerlink" href="#chishop" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="https://github.com/benliles/djangopypi">Chishop</a> is a simple PyPI server written in django which allows you to register/upload with distutils and install with easy_install/pip.</p>
</div>
</div>
</div>
<div class="section" id="for-linux-distributions">
<h2>For Linux Distributions<a class="headerlink" href="#for-linux-distributions" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;For Linux Distributions&#8221; packaging stub</p>
</div>
<div class="section" id="useful-tools">
<h3>Useful Tools<a class="headerlink" href="#useful-tools" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>epm</li>
<li>alien</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Packaging Your Code</a><ul>
<li><a class="reference internal" href="#for-python-developers">For Python Developers</a><ul>
<li><a class="reference internal" href="#pip-vs-easy-install">Pip vs. easy_install</a></li>
<li><a class="reference internal" href="#personal-pypi">Personal PyPI</a><ul>
<li><a class="reference internal" href="#chishop">Chishop</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#for-linux-distributions">For Linux Distributions</a><ul>
<li><a class="reference internal" href="#useful-tools">Useful Tools</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../scenarios/scientific.html" title="previous chapter">Scientific Applications</a></li>
<li>Next: <a href="freezing.html" title="next chapter">Freezing Your Code</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/shipping/packaging.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-256
View File
@@ -1,256 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Your Development Environment &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="&lt;no title&gt;" href="next.html" />
<link rel="prev" title="Properly Installing Python" href="installation.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="next.html" title="&lt;no title&gt;"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation.html" title="Properly Installing Python"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="your-development-environment">
<h1>Your Development Environment<a class="headerlink" href="#your-development-environment" title="Permalink to this headline"></a></h1>
<div class="section" id="text-editors">
<h2>Text Editors<a class="headerlink" href="#text-editors" title="Permalink to this headline"></a></h2>
<div class="section" id="vim">
<h3>VIM<a class="headerlink" href="#vim" title="Permalink to this headline"></a></h3>
<p>There exist a couple of plugins and settings for the VIM editor to aid python
development. If you only develop in Python, a good start is to set the default
settings for indentation and linewrapping to values compliant with PEP8:</p>
<div class="highlight-python"><pre>set textwidth=79
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround</pre>
</div>
<p>With these settings newlines are inserted after 79 characters and indentation
is set to 4 spaces per tab. If you also use VIM for other languages, there is a
handy plugin at <a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=974">indent</a>, which handles indentation settings for python source
files.
Additionally there is also a handy syntax plugin at <a class="reference external" href="http://www.vim.org/scripts/script.php?script_id=790">syntax</a> featuring some
improvements over the syntax file included in VIM 6.1.</p>
<p>These plugins supply you with a basic environment for developing in Python.
However in order to improve the programming flow we also want to continually
check for PEP8 compliance and check syntax. Luckily there exist <a class="reference external" href="http://pypi.python.org/pypi/pep8/">PEP8</a> and
<a href="#id4"><span class="problematic" id="id5">Pyflakes_</span></a> to do this for you. If your VIM is compiled with <cite>+python</cite> you can
also utilize some very handy plugins to do these checks from within the editor.
For PEP8 checking install <a class="reference external" href="https://github.com/nvie/vim-pep8">vim-pep8</a>. Now you can map the vim function
<cite>Pep8()</cite> to any hotkey or action you want. Similarly for pyflakes you can
install <a class="reference external" href="https://github.com/nvie/vim-pyflakes">vim-pyflakes</a>. Now you can map <cite>Pyflakes()</cite> like the PEP8 function and
have it called quickly. Both plugins will display errors in a quickfix list and
provide an easy way to jump to the corresponding line. A very handy setting is
calling these functions whenever a buffer is saved. In order to do this, enter
the following lines into your vimrc:</p>
<div class="highlight-python"><pre>autocmd BufWritePost *.py call Pyflakes()
autocmd BufWritePost *.py call Pep8()</pre>
</div>
</div>
</div>
<div class="section" id="ides">
<h2>IDEs<a class="headerlink" href="#ides" title="Permalink to this headline"></a></h2>
<div class="section" id="pycharm-intellij-idea">
<h3>PyCharm / IntelliJ IDEA<a class="headerlink" href="#pycharm-intellij-idea" title="Permalink to this headline"></a></h3>
<p>PyCharm is developed by JetBrains, also known for IntelliJ IDEA. Both share the same code base and most of PyCharm&#8217;s features can be brought to IntelliJ with the free <a class="reference external" href="http://plugins.intellij.net/plugin/?id=631/">Python Plug-In</a>..</p>
</div>
<div class="section" id="eclipse">
<h3>Eclipse<a class="headerlink" href="#eclipse" title="Permalink to this headline"></a></h3>
<p>The most popular Eclipse plugin for Python development is Aptana&#8217;s
<a class="reference external" href="http://pydev.org">PyDev</a>.</p>
</div>
<div class="section" id="komodo-ide">
<h3>Komodo IDE<a class="headerlink" href="#komodo-ide" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.activestate.com/komodo-ide">Komodo IDE</a> is developed by ActiveState and is a commerical IDE for Windows, Mac
and Linux.</p>
</div>
<div class="section" id="spyder">
<h3>Spyder<a class="headerlink" href="#spyder" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://code.google.com/p/spyderlib/">Spyder</a> an IDE specifically geared toward working with scientific python libraries (namely <a class="reference external" href="http://www.scipy.org/">Scipy</a>).
Includes integration with <a class="reference external" href="http://pypi.python.org/pypi/pyflakes">pyflakes</a>, <a class="reference external" href="http://www.logilab.org/857">pylint</a>,
and <a class="reference external" href="http://rope.sourceforge.net/">rope</a>.</p>
<p>Spyder is open-source (free), offers code completion, syntax highlighting, class and function browser, and object
inspection</p>
</div>
</div>
<div class="section" id="interpreter-tools">
<h2>Interpreter Tools<a class="headerlink" href="#interpreter-tools" title="Permalink to this headline"></a></h2>
<div class="section" id="virtualenv">
<h3>virtualenv<a class="headerlink" href="#virtualenv" title="Permalink to this headline"></a></h3>
<p>Virtualenv is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them.
It solves the &#8220;Project X depends on version 1.x but, Project Y needs 4.x&#8221; dilemma and keeps your global site-packages directory clean and manageable.</p>
</div>
<div class="section" id="virtualenvwrapper">
<h3>virtualenvwrapper<a class="headerlink" href="#virtualenvwrapper" title="Permalink to this headline"></a></h3>
<p>Virtualenvwrapper makes virtualenv a pleasure to use by wrapping the command line API with a nicer CLI.</p>
<div class="highlight-python"><pre>pip install virtualenvwrapper</pre>
</div>
<p>Put this into your <cite>~/.bash_profile</cite> (Linux/Mac) file:</p>
<div class="highlight-python"><pre>export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'</pre>
</div>
<p>This will prevent your virtualenvs from relying on your (global) site packages directory, so that they are completely separate..</p>
</div>
</div>
<div class="section" id="other-tools">
<h2>Other Tools<a class="headerlink" href="#other-tools" title="Permalink to this headline"></a></h2>
<div class="section" id="ipython">
<h3>IPython<a class="headerlink" href="#ipython" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>$ pip install ipython</pre>
</div>
</div>
<div class="section" id="bpython">
<h3>BPython<a class="headerlink" href="#bpython" title="Permalink to this headline"></a></h3>
<div class="highlight-python"><pre>$ pip install bpython</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Your Development Environment</a><ul>
<li><a class="reference internal" href="#text-editors">Text Editors</a><ul>
<li><a class="reference internal" href="#vim">VIM</a></li>
</ul>
</li>
<li><a class="reference internal" href="#ides">IDEs</a><ul>
<li><a class="reference internal" href="#pycharm-intellij-idea">PyCharm / IntelliJ IDEA</a></li>
<li><a class="reference internal" href="#eclipse">Eclipse</a></li>
<li><a class="reference internal" href="#komodo-ide">Komodo IDE</a></li>
<li><a class="reference internal" href="#spyder">Spyder</a></li>
</ul>
</li>
<li><a class="reference internal" href="#interpreter-tools">Interpreter Tools</a><ul>
<li><a class="reference internal" href="#virtualenv">virtualenv</a></li>
<li><a class="reference internal" href="#virtualenvwrapper">virtualenvwrapper</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-tools">Other Tools</a><ul>
<li><a class="reference internal" href="#ipython">IPython</a></li>
<li><a class="reference internal" href="#bpython">BPython</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="installation.html" title="previous chapter">Properly Installing Python</a></li>
<li>Next: <a href="next.html" title="next chapter">&lt;no title&gt;</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/starting/dev-env.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-275
View File
@@ -1,275 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Properly Installing Python &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Your Development Environment" href="dev-env.html" />
<link rel="prev" title="Picking an Interpreter" href="which-python.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="dev-env.html" title="Your Development Environment"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="which-python.html" title="Picking an Interpreter"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="properly-installing-python">
<h1>Properly Installing Python<a class="headerlink" href="#properly-installing-python" title="Permalink to this headline"></a></h1>
<div class="section" id="mac-os-x">
<h2>Mac OS X<a class="headerlink" href="#mac-os-x" title="Permalink to this headline"></a></h2>
<p><em>Or, &#8220;Installing Python 2.7 via Homebrew&#8221;.</em></p>
<div class="section" id="package-manager">
<h3>Package Manager<a class="headerlink" href="#package-manager" title="Permalink to this headline"></a></h3>
<p>While Snow Leopard comes with a large number of UNIX utilities, those
familiar with Linux systems will notice one key component missing: a
package manager. Mxcl&#8217;s <em>Homebrew</em> is the answer.</p>
<p>To install Homebrew, simply run:</p>
<div class="highlight-python"><pre>$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"</pre>
</div>
<p>It&#8217;s basic commands are <strong>update</strong>, <strong>install</strong>, and <strong>remove</strong>.</p>
<p>And we can now install Python 2.7:</p>
<div class="highlight-python"><pre>$ brew install python --framework</pre>
</div>
<p>The <tt class="docutils literal"><span class="pre">--framework</span></tt> option tells Homebrew to compile a Framework-style Python build, rather than a UNIX-style build. The outdated version of Python that Snow Leopard comes packaged with
is built as a Framework, so this helps avoid some future module installation
bugs.</p>
<p><em>Don&#8217;t forget to update your environment PATH.</em></p>
</div>
<div class="section" id="building-from-source">
<h3>Building From Source<a class="headerlink" href="#building-from-source" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="distribute-pip">
<h3>Distribute &amp; Pip<a class="headerlink" href="#distribute-pip" title="Permalink to this headline"></a></h3>
<p><em>Distribute</em> is a fantastic drop-in replacement for <em>easy_install</em> and
<em>setuptools</em>. It allows you to install and manage python packages from
pypi.python.org, amongst a few other sources. It also plays well with
<em>virtualenv</em> and user-enviornments.</p>
<p><strong>easy_install</strong> is considered by many to be a deprecated system, so we
will install it&#8217;s replacement: <strong>pip</strong>. Pip allows for uninstallation
of packages, and is actively maintained, unlike setuptool&#8217;s easy_install.</p>
<p>To install <em>pip</em> and Distribute&#8217;s <em>easy_install</em>:</p>
<p>If you have homebrew:</p>
<div class="highlight-python"><pre>$ brew install pip</pre>
</div>
<p>...And, if you&#8217;re a masochist:</p>
<div class="highlight-python"><pre>$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
$ easy_install pip</pre>
</div>
<p>To install <tt class="docutils literal"><span class="pre">pip</span></tt>:</p>
<p>Hopefully you&#8217;ll never have to use <strong>easy_install</strong> again.</p>
</div>
<div class="section" id="updating-python">
<h3>Updating Python<a class="headerlink" href="#updating-python" title="Permalink to this headline"></a></h3>
<p>Homebrew makes it simple.</p>
<div class="highlight-python"><pre>$ brew update
$ brew install --force python</pre>
</div>
</div>
</div>
<div class="section" id="windows">
<h2>Windows<a class="headerlink" href="#windows" title="Permalink to this headline"></a></h2>
<div class="section" id="prerequisites">
<h3>Prerequisites:<a class="headerlink" href="#prerequisites" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>Python2.7 (x86) from Python.org</li>
<li>Microsoft Visual Studio</li>
</ul>
</div>
<div class="section" id="step-1-install-distribute-pip">
<h3>Step 1: Install Distribute &amp; Pip<a class="headerlink" href="#step-1-install-distribute-pip" title="Permalink to this headline"></a></h3>
<p><strong>Distribute</strong> is a fantastic drop-in replacement for <strong>easy_install</strong> and <strong>setuptools</strong>. It allows you to install and manage python packages from PyPi, amongst a few other sources.</p>
<dl class="docutils">
<dt>To install it, run the python script available here:</dt>
<dd>&lt;<a class="reference external" href="http://python-distribute.org/distribute_setup.py">http://python-distribute.org/distribute_setup.py</a>&gt;</dd>
</dl>
<p>Make sure that <tt class="docutils literal"><span class="pre">`C:\Python27\`</span></tt>, and <tt class="docutils literal"><span class="pre">`C:\Python27\Scripts`</span></tt> are in your PATH.</p>
<p><strong>easy_install</strong> is considered by many to be a deprecated system, so we will install it&#8217;s replacement: <strong>pip</strong>. Pip allows for uninstallation of packages, and is actively maintained, unlike setuptool&#8217;s easy_install.</p>
<p>To install pip, simply run:</p>
<div class="highlight-python"><pre>$ easy_install pip</pre>
</div>
</div>
</div>
<div class="section" id="linux-ubuntu">
<h2>Linux (Ubuntu)<a class="headerlink" href="#linux-ubuntu" title="Permalink to this headline"></a></h2>
<p>Oneiric Ocelot, the latest version of Ubuntu, <strong>comes with Python 2.7 out of the box</strong>. Python 3.2 can be installed and run with the following commands:</p>
<div class="highlight-python"><pre>$ sudo apt-get install python3-minimal
$ python3</pre>
</div>
<p>Older versions of Python aren&#8217;t available from the official repository. However, if it&#8217;s needed (for example to support legacy code), we can add an unsupported repository and install an older version of Python (2.5 in the example below):</p>
<div class="highlight-python"><pre>$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.5</pre>
</div>
<div class="section" id="installing-setuptools-and-pip">
<h3>Installing setuptools and pip<a class="headerlink" href="#installing-setuptools-and-pip" title="Permalink to this headline"></a></h3>
<p>While Python has an extensive standard library, the set of packages available from the Internet is even more extensive. In order to install them easily, we&#8217;ll install the <tt class="docutils literal"><span class="pre">setuptools</span></tt> package and <tt class="docutils literal"><span class="pre">pip</span></tt> installer:</p>
<div class="highlight-python"><pre>.. XXX: sudo?</pre>
</div>
<blockquote>
<div>$ wget <a class="reference external" href="http://python-distribute.org/distribute_setup.py">http://python-distribute.org/distribute_setup.py</a>
$ python distribute_setup.py
$ wget <a class="reference external" href="https://raw.github.com/pypa/pip/master/contrib/get-pip.py">https://raw.github.com/pypa/pip/master/contrib/get-pip.py</a>
$ python get-pip.py
$ rm get-pip.py distribute_setup.py</div></blockquote>
<p>Now, most Python packages can be installed using the <tt class="docutils literal"><span class="pre">pip</span></tt> command. For example, if we wanted to install Django:</p>
<div class="highlight-python"><pre>$ sudo pip install django</pre>
</div>
<p>A full list of <tt class="docutils literal"><span class="pre">pip</span></tt>&#8216;s capabilities is available by typing <tt class="docutils literal"><span class="pre">pip</span> <span class="pre">--help</span></tt>.</p>
</div>
<div class="section" id="linux-manual">
<h3>Linux (Manual)<a class="headerlink" href="#linux-manual" title="Permalink to this headline"></a></h3>
<p>While your system will quite likely already have Python installation, you might wish to install a different version. This is done in the typical Linux software source install procedure:</p>
<div class="highlight-python"><pre>$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
$ tar -xvf Python-2.7.2.tgz
$ cd Python-2.7.2
$ ./configure
$ make
$ make install</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Properly Installing Python</a><ul>
<li><a class="reference internal" href="#mac-os-x">Mac OS X</a><ul>
<li><a class="reference internal" href="#package-manager">Package Manager</a></li>
<li><a class="reference internal" href="#building-from-source">Building From Source</a></li>
<li><a class="reference internal" href="#distribute-pip">Distribute &amp; Pip</a></li>
<li><a class="reference internal" href="#updating-python">Updating Python</a></li>
</ul>
</li>
<li><a class="reference internal" href="#windows">Windows</a><ul>
<li><a class="reference internal" href="#prerequisites">Prerequisites:</a></li>
<li><a class="reference internal" href="#step-1-install-distribute-pip">Step 1: Install Distribute &amp; Pip</a></li>
</ul>
</li>
<li><a class="reference internal" href="#linux-ubuntu">Linux (Ubuntu)</a><ul>
<li><a class="reference internal" href="#installing-setuptools-and-pip">Installing setuptools and pip</a></li>
<li><a class="reference internal" href="#linux-manual">Linux (Manual)</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="which-python.html" title="previous chapter">Picking an Interpreter</a></li>
<li>Next: <a href="dev-env.html" title="next chapter">Your Development Environment</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/starting/installation.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-132
View File
@@ -1,132 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>&lt;no title&gt; &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Structuring Your Project" href="../writing/structure.html" />
<link rel="prev" title="Your Development Environment" href="dev-env.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../writing/structure.html" title="Structuring Your Project"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="dev-env.html" title="Your Development Environment"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p><h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="dev-env.html" title="previous chapter">Your Development Environment</a></li>
<li>Next: <a href="../writing/structure.html" title="next chapter">Structuring Your Project</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/starting/next.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-225
View File
@@ -1,225 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Picking an Interpreter &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Properly Installing Python" href="installation.html" />
<link rel="prev" title="News" href="../intro/news.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="installation.html" title="Properly Installing Python"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../intro/news.html" title="News"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="picking-an-interpreter">
<h1>Picking an Interpreter<a class="headerlink" href="#picking-an-interpreter" title="Permalink to this headline"></a></h1>
<p>Which Python to use?</p>
<div class="section" id="x-vs-3-x">
<h2>2.x vs 3.x<a class="headerlink" href="#x-vs-3-x" title="Permalink to this headline"></a></h2>
<p><strong>tl;dr</strong>: Python 2.x is the status quo, Python 3.x is the shiny new thing.</p>
<p><a class="reference external" href="http://wiki.python.org/moin/Python2orPython3">Further Reading</a></p>
<div class="section" id="today">
<h3>Today<a class="headerlink" href="#today" title="Permalink to this headline"></a></h3>
<p>If you&#8217;re choosing a Python interpreter to use, I <em>highly</em> recommend you Use Python 2.7.x, unless you have a strong reason not to.</p>
</div>
<div class="section" id="the-future">
<h3>The Future<a class="headerlink" href="#the-future" title="Permalink to this headline"></a></h3>
<p>As more and more modules get ported over to Python3, the easier it will be for
others to use it.</p>
</div>
</div>
<div class="section" id="which-python-to-support">
<h2>Which Python to Support?<a class="headerlink" href="#which-python-to-support" title="Permalink to this headline"></a></h2>
<p>If you&#8217;re starting work on a new Python module, I recommend you write it for
Python 2.5 or 2.6, and add support for Python3 in a later iteration.</p>
</div>
<div class="section" id="implementations">
<h2>Implementations<a class="headerlink" href="#implementations" title="Permalink to this headline"></a></h2>
<p>There are several popular implementations of the Python programming language on
different back-ends.</p>
<div class="section" id="cpython">
<h3>CPython<a class="headerlink" href="#cpython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.python.org">CPython</a> is the reference implementation of Python,
written in C. It compiles Python code to intermediate bytecode which is then
interpreted by a virtual machine. When people speak of <em>Python</em> they often mean
not just the language but also this implementation. It provides the highest
level of compatibility with Python packages and C extension modules.</p>
<p>If you are writing open-source Python code and want to reach the widest possible
audience, targeting CPython is your best bet. If you need to use any packages
that are rely on C extensions for their functionality (eg: numpy) then CPython
is your only choice.</p>
<p>Being the reference implementation, all versions of the Python language are
available as CPython. Python 3 is only available in a CPython implementation.</p>
</div>
<div class="section" id="pypy">
<h3>PyPy<a class="headerlink" href="#pypy" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://pypy.org/">PyPy</a> is a Python interpreter implemented in a restricted
statically-typed subset of the Python language called RPython. The interpreter
features a just-in-time compiler and supports multiple back-ends (C, CLI, JVM).</p>
<p>PyPy aims for maximum compatibility with the reference CPython implementation
while improving performance.</p>
<p>If you are looking to squeeze more performance out of your Python code, it&#8217;s
worth giving PyPy a try.</p>
<p>Currently PyPy supports Python 2.7.</p>
</div>
<div class="section" id="jython">
<h3>Jython<a class="headerlink" href="#jython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://www.jython.org/">Jython</a> is a Python implementation that compiles
Python code to Java byte code that then executes on a JVM. It has the additional
advantage of being able to import and use any Java class the same as a Python
module.</p>
<p>If you need to interface with an existing Java codebase or have other reasons to
need to write Python code for the JVM, Jython is the best choice.</p>
<p>Currently Jython supports up to Python 2.5.</p>
</div>
<div class="section" id="ironpython">
<h3>IronPython<a class="headerlink" href="#ironpython" title="Permalink to this headline"></a></h3>
<p><a class="reference external" href="http://ironpython.net/">IronPython</a> is an implementation of Python for .NET
framework. It can use both Python and .NET framework libraries, and can also
expose Python code to other .NET languages.</p>
<p><a class="reference external" href="http://ironpython.net/tools/">Python Tools for Visual Studio</a> integrate
IronPython directly in to the Visual Studio development environment, making it
an ideal choice for Windows developers.</p>
<p>IronPython supports Python 2.7.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Picking an Interpreter</a><ul>
<li><a class="reference internal" href="#x-vs-3-x">2.x vs 3.x</a><ul>
<li><a class="reference internal" href="#today">Today</a></li>
<li><a class="reference internal" href="#the-future">The Future</a></li>
</ul>
</li>
<li><a class="reference internal" href="#which-python-to-support">Which Python to Support?</a></li>
<li><a class="reference internal" href="#implementations">Implementations</a><ul>
<li><a class="reference internal" href="#cpython">CPython</a></li>
<li><a class="reference internal" href="#pypy">PyPy</a></li>
<li><a class="reference internal" href="#jython">Jython</a></li>
<li><a class="reference internal" href="#ironpython">IronPython</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../intro/news.html" title="previous chapter">News</a></li>
<li>Next: <a href="installation.html" title="next chapter">Properly Installing Python</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/starting/which-python.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-223
View File
@@ -1,223 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documenting Your Code &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Testing Your Code" href="tests.html" />
<link rel="prev" title="Code Style" href="style.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="tests.html" title="Testing Your Code"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="style.html" title="Code Style"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="documenting-your-code">
<h1>Documenting Your Code<a class="headerlink" href="#documenting-your-code" title="Permalink to this headline"></a></h1>
<p>Documenting your code is extremely important. It is debatebly even
more important than testing.</p>
<div class="section" id="the-basics">
<h2>The Basics<a class="headerlink" href="#the-basics" title="Permalink to this headline"></a></h2>
<div class="section" id="code-comments">
<h3>Code Comments<a class="headerlink" href="#code-comments" title="Permalink to this headline"></a></h3>
<p>Information regarding code comments is taken from PEP 008 (<a class="reference external" href="http://www.python.org/dev/peps/pep-0008/">http://www.python.org/dev/peps/pep-0008/</a>).
Block comment styling should be used when commenting out multiple lines of code.:</p>
<div class="highlight-python"><pre>Block comments generally apply to some (or all) code that follows them,
and are indented to the same level as that code. Each line of a block
comment starts with a # and a single space (unless it is indented text
inside the comment).
Paragraphs inside a block comment are separated by a line containing a
single #.</pre>
</div>
<p>Inline comments are used for individual lines and should be used sparingly.:</p>
<div class="highlight-python"><pre>An inline comment is a comment on the same line as a statement. Inline
comments should be separated by at least two spaces from the statement.
They should start with a # and a single space.
Inline comments are unnecessary and in fact distracting if they state
the obvious. Don't do this:
x = x + 1 # Increment x
But sometimes, this is useful: ::
x = x + 1 # Compensate for border</pre>
</div>
</div>
<div class="section" id="doc-strings">
<h3>Doc Strings<a class="headerlink" href="#doc-strings" title="Permalink to this headline"></a></h3>
<p>PEP 257 is the primary reference for docstrings. (<a class="reference external" href="http://www.python.org/dev/peps/pep-0257/">http://www.python.org/dev/peps/pep-0257/</a>)
<a href="#id1"><span class="problematic" id="id2">|</span></a>There are two types of docstrings, one-line and multi-line. Their names should be fairly self explanatory.
<a href="#id3"><span class="problematic" id="id4">|</span></a>One-line docstrings:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">kos_root</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Return the pathname of the KOS root directory.&quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">_kos_root</span>
<span class="k">if</span> <span class="n">_kos_root</span><span class="p">:</span> <span class="k">return</span> <span class="n">_kos_root</span>
<span class="o">...</span>
</pre></div>
</div>
<p>Multi-line docstrings:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">complex</span><span class="p">(</span><span class="n">real</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">imag</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Form a complex number.</span>
<span class="sd"> Keyword arguments:</span>
<span class="sd"> real -- the real part (default 0.0)</span>
<span class="sd"> imag -- the imaginary part (default 0.0)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">imag</span> <span class="o">==</span> <span class="mf">0.0</span> <span class="ow">and</span> <span class="n">real</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">:</span> <span class="k">return</span> <span class="n">complex_zero</span>
<span class="o">...</span>
</pre></div>
</div>
</div>
<div class="section" id="sphinx">
<h3>Sphinx<a class="headerlink" href="#sphinx" title="Permalink to this headline"></a></h3>
<p>Sphinx (<a class="reference external" href="http://sphinx.pocoo.org">http://sphinx.pocoo.org</a>) is a tool which converts documentation in the reStructured text markup language into a range of output formats including HTML, LaTeX (for printable PDF versions), manual pages and plain text.</p>
</div>
</div>
<div class="section" id="other-tools">
<h2>Other Tools<a class="headerlink" href="#other-tools" title="Permalink to this headline"></a></h2>
<div class="section" id="that-old-thing">
<h3>that old thing<a class="headerlink" href="#that-old-thing" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="pocco-docco-shocco">
<h3>pocco / docco / shocco<a class="headerlink" href="#pocco-docco-shocco" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="ronn">
<h3>Ronn<a class="headerlink" href="#ronn" title="Permalink to this headline"></a></h3>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Documenting Your Code</a><ul>
<li><a class="reference internal" href="#the-basics">The Basics</a><ul>
<li><a class="reference internal" href="#code-comments">Code Comments</a></li>
<li><a class="reference internal" href="#doc-strings">Doc Strings</a></li>
<li><a class="reference internal" href="#sphinx">Sphinx</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-tools">Other Tools</a><ul>
<li><a class="reference internal" href="#that-old-thing">that old thing</a></li>
<li><a class="reference internal" href="#pocco-docco-shocco">pocco / docco / shocco</a></li>
<li><a class="reference internal" href="#ronn">Ronn</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="style.html" title="previous chapter">Code Style</a></li>
<li>Next: <a href="tests.html" title="next chapter">Testing Your Code</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/writing/documentation.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
-199
View File
@@ -1,199 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Choosing a License &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Packaging Your Code" href="../shipping/packaging.html" />
<link rel="prev" title="Testing Your Code" href="tests.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../shipping/packaging.html" title="Packaging Your Code"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="tests.html" title="Testing Your Code"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="choosing-a-license">
<h1>Choosing a License<a class="headerlink" href="#choosing-a-license" title="Permalink to this headline"></a></h1>
<p>Open source.</p>
<div class="section" id="non-restrictive">
<h2>Non-Restrictive<a class="headerlink" href="#non-restrictive" title="Permalink to this headline"></a></h2>
<div class="section" id="psfl">
<h3>PSFL<a class="headerlink" href="#psfl" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="mit-bsd-isc">
<h3>MIT / BSD / ISC<a class="headerlink" href="#mit-bsd-isc" title="Permalink to this headline"></a></h3>
<div class="section" id="mit-x11">
<h4>MIT (X11)<a class="headerlink" href="#mit-x11" title="Permalink to this headline"></a></h4>
</div>
<div class="section" id="new-bsd">
<h4>New BSD<a class="headerlink" href="#new-bsd" title="Permalink to this headline"></a></h4>
</div>
<div class="section" id="isc">
<h4>ISC<a class="headerlink" href="#isc" title="Permalink to this headline"></a></h4>
</div>
</div>
<div class="section" id="apache">
<h3>Apache<a class="headerlink" href="#apache" title="Permalink to this headline"></a></h3>
</div>
</div>
<div class="section" id="restrictive">
<h2>Restrictive<a class="headerlink" href="#restrictive" title="Permalink to this headline"></a></h2>
<div class="section" id="lgpl">
<h3>LGPL<a class="headerlink" href="#lgpl" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="gpl">
<h3>GPL<a class="headerlink" href="#gpl" title="Permalink to this headline"></a></h3>
<div class="section" id="gplv2">
<h4>GPLv2<a class="headerlink" href="#gplv2" title="Permalink to this headline"></a></h4>
</div>
<div class="section" id="gplv3">
<h4>GPLv3<a class="headerlink" href="#gplv3" title="Permalink to this headline"></a></h4>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">About This Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Choosing a License</a><ul>
<li><a class="reference internal" href="#non-restrictive">Non-Restrictive</a><ul>
<li><a class="reference internal" href="#psfl">PSFL</a></li>
<li><a class="reference internal" href="#mit-bsd-isc">MIT / BSD / ISC</a><ul>
<li><a class="reference internal" href="#mit-x11">MIT (X11)</a></li>
<li><a class="reference internal" href="#new-bsd">New BSD</a></li>
<li><a class="reference internal" href="#isc">ISC</a></li>
</ul>
</li>
<li><a class="reference internal" href="#apache">Apache</a></li>
</ul>
</li>
<li><a class="reference internal" href="#restrictive">Restrictive</a><ul>
<li><a class="reference internal" href="#lgpl">LGPL</a></li>
<li><a class="reference internal" href="#gpl">GPL</a><ul>
<li><a class="reference internal" href="#gplv2">GPLv2</a></li>
<li><a class="reference internal" href="#gplv3">GPLv3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="tests.html" title="previous chapter">Testing Your Code</a></li>
<li>Next: <a href="../shipping/packaging.html" title="next chapter">Packaging Your Code</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/writing/license.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2011. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project.
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More