GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • DjangoGirls
  • hundreds of people
  • are welcome
  • The Guide Website
  • The Guide @ GitHub
  • Issue Tracker
  • The Guide as a PDF
  • French
  • Chinese
  • Japanese
  • Korean
  • Filipino
  • Brazilian Portuguese

This view

  • Original page
  • New address

GeezerVison is showing docs.python-guide.org — The Hitchhiker’s Guide to Python! — The Hitchhiker's Guide to Python

The Hitchhiker’s Guide to Python!¶

Greetings, Earthling! Welcome to The Hitchhiker’s Guide to Python.

This is a living, breathing guide. If you’d like to contribute, fork us on GitHub!

This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook for the installation, configuration, and usage of Python on a daily basis.

This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation. You won’t find a list of every Python web framework available here. Rather, you’ll find a nice concise list of highly recommended options.

Note

The use of Python 3 is highly recommended over Python 2. Consider upgrading your applications and infrastructures if you find yourself still using Python 2 in production today. If you are using Python 3, congratulations — you are indeed a person of excellent taste. —Kenneth Reitz

Let’s get started! But first, let’s make sure you know where your towel is.

Getting Started with Python¶

New to Python? Let’s properly setup up your Python environment:

  • Picking a Python Interpreter (3 vs 2)
    • The State of Python (3 & 2)
    • Recommendations
    • So…. 3?
    • Implementations
  • Properly Install Python on your system:
  • Properly Installing Python
  • Installing Python 3 on Mac OS X
  • Installing Python 3 on Windows
  • Installing Python 3 on Linux
  • Installing Python 2 on Mac OS X
  • Installing Python 2 on Windows
  • Installing Python 2 on Linux
  • Using Virtualenvs with Pipenv:
  • Pipenv & Virtual Environments
    • Make sure you’ve got Python & pip
    • Installing Pipenv
    • Installing packages for your project
    • Using installed packages
    • Next steps
  • Lower level: virtualenv
    • Basic Usage
    • Other Notes
    • virtualenvwrapper
    • virtualenv-burrito
    • direnv

Python Development Environments¶

This part of the guide focuses on the Python development environment, and the best-practice tools that are available for writing Python code.

  • Your Development Environment
    • Text Editors
    • IDEs
    • Interpreter Tools
    • Other Tools
  • Pipenv & Virtual Environments
    • Make sure you’ve got Python & pip
    • Installing Pipenv
    • Installing packages for your project
    • Using installed packages
    • Next steps
  • Lower level: virtualenv
    • Basic Usage
    • Other Notes
    • virtualenvwrapper
    • virtualenv-burrito
    • direnv
  • Further Configuration of pip and Virtualenv
    • Requiring an active virtual environment for pip
    • Caching packages for future use

Writing Great Python Code¶

This part of the guide focuses on the best-practices for writing Python code.

  • Structuring Your Project
    • Structure of the Repository
    • Structure of Code is Key
    • Modules
    • Packages
    • Object-oriented programming
    • Decorators
    • Context Managers
    • Dynamic typing
    • Mutable and immutable types
    • Vendorizing Dependencies
    • Runners
    • Further Reading
  • Code Style
    • General concepts
    • Idioms
    • Zen of Python
    • PEP 8
    • Conventions
  • Reading Great Code
  • Documentation
    • Project Documentation
    • Project Publication
    • Code Documentation Advice
    • Other Tools
  • Testing Your Code
    • The Basics
    • Tools
  • Logging
    • … or Print?
    • Logging in a Library
    • Logging in an Application
  • Common Gotchas
    • Mutable Default Arguments
    • Late Binding Closures
    • Bytecode (.pyc) Files Everywhere!
  • Choosing a License

Scenario Guide for Python Applications¶

This part of the guide focuses on tool and module advice based on different scenarios.

  • Network Applications
    • HTTP
    • Distributed Systems
  • Web Applications & Frameworks
    • Context
    • Frameworks
    • Web Servers
    • WSGI Servers
    • Server Best Practices
    • Hosting
    • Templating
  • HTML Scraping
    • Web Scraping
    • lxml and Requests
  • Command-line Applications
    • Click
    • docopt
    • Plac
    • Cliff
    • Cement
    • Python Fire
  • GUI Applications
    • Camelot
    • Cocoa
    • GTk
    • PyGObject aka (PyGi)
    • Kivy
    • PyObjC
    • PySide
    • PyQt
    • Pyjs Desktop (formerly Pyjamas Desktop)
    • Qt
    • PySimpleGUI
    • Toga
    • Tk
    • wxPython
  • Databases
    • DB-API
    • SQLAlchemy
    • Records
    • PugSQL
    • Django ORM
    • peewee
    • PonyORM
    • SQLObject
  • Networking
    • Twisted
    • PyZMQ
    • gevent
  • Systems Administration
    • Fabric
    • Salt
    • Psutil
    • Ansible
    • Chef
    • Puppet
    • Blueprint
    • Buildout
  • Continuous Integration
    • Why?
    • Jenkins
    • Buildbot
    • Tox
    • Travis-CI
  • Speed
    • Context
    • C Extensions
    • Concurrency
  • Scientific Applications
    • Context
    • Tools
    • Libraries
    • Resources
  • Image Manipulation
    • Python Imaging Library
    • Open Source Computer Vision
  • Data Serialization
    • What is data serialization?
    • Flat vs. Nested data
    • Serializing Text
    • Binary
    • Protobuf
  • XML parsing
    • untangle
    • xmltodict
    • xmlschema
  • JSON
    • Parsing JSON
  • Cryptography
    • cryptography
    • GPGME bindings
  • Machine Learning
    • SciPy Stack
    • scikit-learn
  • Interfacing with C/C++ Libraries
    • C Foreign Function Interface
    • ctypes
    • SWIG
    • Boost.Python

Shipping Great Python Code¶

This part of the guide focuses on sharing and deploying your Python code.

  • Publishing Your Code
    • Creating a Project Repo on GitHub
    • When Your Project Grows
  • Packaging Your Code
    • Alternatives to Packaging
    • For Python Developers
    • For Linux Distributions
  • Freezing Your Code
    • Alternatives to Freezing
    • Comparison of Freezing Tools
    • Windows
    • OS X
    • Linux

Additional Notes¶

This part of the guide, which is mostly prose, begins with some background information about Python, and then focuses on next steps.

  • Introduction
    • About This Guide
  • The Community
    • BDFL
    • Python Software Foundation
    • PEPs
    • Python Conferences
    • Python User Groups
    • Online Communities
    • Python Job Boards
  • Learning Python
    • Beginner
    • Intermediate
    • Advanced
    • For Engineers and Scientists
    • Miscellaneous Topics
    • References
  • Documentation
    • Official Documentation
    • Read the Docs
    • pydoc
  • News
    • PyCoder’s Weekly
    • Real Python
    • Planet Python
    • /r/python
    • Talk Python Podcast
    • Python Bytes Podcast
    • Python Weekly
    • Python News
    • Import Python Weekly
    • Awesome Python Newsletter

Note

Notes defined within all diatonic and chromatic musical scales have been intentionally excluded from this list of additional notes. Additionally, this note.


Contribution notes and legal information (for those interested).

  • Contribute
    • Style Guide
    • Todo List
  • License
  • The Guide Style Guide
    • Relevancy
    • Headings
    • Prose
    • Code Examples
    • Externally Linking
    • Linking to Sections in The Guide
    • Notes and Warnings
    • TODOs

©2011-2026 Kenneth Reitz & Real Python. CC BY-NC-SA 3.0

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.