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 daobook.github.io — Python 搭车指南! — The Hitchhiker's Guide to Python

Python 搭车指南!¶

你好,地球人!欢迎来到 《Python 搭车指南》。

这是一份活着的、会呼吸的指南。如果你想做出贡献,fork 我们的 GitHub !

这本手工制作的指南旨在为 Python 新手和专业开发者提供一本关于 Python 的安装、配置和日常使用的最佳实践手册。

本指南是固执己见的,其方式几乎,但不完全,完全不像 Python 的官方文档。你不会在这里找到所有可用的 Python 网络框架的列表。相反,你会发现一个简明扼要的高度推荐选择清单。

注解

强烈建议使用 Python 3,而不是 Python 2。如果你发现自己今天仍在生产中使用 Python 2,请考虑升级你的应用程序和基础设施。如果你正在使用 Python 3,那么恭喜你 —— 你确实是一个有品位的人。—— Kenneth Reitz

让我们开始吧! 但首先,让我们确保你知道你的浴巾在哪里。(译者注:towel 浴巾的梗引自著名科幻小说《银河系漫游指南》,大概是说先准备好不起眼但很重要的东西。)

Python 入门篇¶

初次接触 Python?让我们适当地设置一下你的 Python 环境:

  • Picking a Python Interpreter (3 vs 2)
    • The State of Python (3 & 2)
    • Recommendations
    • So…. 3?
    • Implementations
  • 在系统中正确安装 Python:
  • 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
  • 在 Pipenv 中使用 Virtualenvs:
  • 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 开发环境¶

这部分指南的重点是 Python 开发环境,以及可用于编写 Python 代码的最佳实践工具。

  • 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

编写优雅的 Python 代码¶

这部分指南的重点是编写 Python 代码的最佳实践。

  • 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

Python 应用场景指南¶

指南的这一部分侧重于基于不同场景的工具和模块建议。

  • 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
    • Shinken
  • 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
  • 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

运用伟大的 Python 代码¶

这一部分指南的重点是分享和部署你的 Python 代码。

  • 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

补充说明¶

指南的这一部分主要是序言,首先是关于 Python 的一些背景信息,然后重点是下一步。

  • 介绍
    • 关于这份指南
  • 社区
    • BDFL
    • Python 软件基金会
    • PEPs
    • Python 会议
    • Python 用户组
    • 在线社区
    • Python 工作公告栏
  • 学习 Python
    • 初学者
    • 中级
    • 高级
    • 工程师和科学家
    • 各种各样的话题
    • 参考
  • 文档
    • 官方文档
    • Read the Docs
    • pydoc
  • 新闻
    • 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

注解

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


贡献说明和法律信息(供感兴趣的人参考)。

  • 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-2021 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.