[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Python Programming - Wikibooks, open books for an open world

This book describes Python, an open-source general-purpose interpreted programming language available for the most popular operating systems. The current versions are 3.x while 2.x is no longer supported, since 2020. This book describes primarily the unsupported version 2 (while often the same code works in version 3), but does at times reference changes in version 3.

There are a few implementations for Python 3 (and older): the standard implementation written in C, and PyPy, a JIT-compiled version written in RPython - a subset of Python. For Python 2 only there are Jython written in Java and IronPython written in C# for the .NET environment.

Contents[edit | edit source]

Intro[edit | edit source]

A printable version of Python Programming is available. (edit it)

A PDF version is available. (info)

An E-Book Reader optimized PDF Version is available.

Overview
Getting Python
Setting it up
Interactive mode
Self Help

Basics[edit | edit source]

Creating Python programs
Variables and Strings
Basic syntax
Sequences (Strings, Lists, Tuples, Dictionaries, Sets)
Data types
Numbers
Strings
Lists
Tuples
Dictionaries
Sets
Basic Math -- redundant to "Operators"
Operators
Control Flow
Decision Control
Conditional Statements
Loops
Functions
Scoping
Input and output
Files
Text
Modules
Classes
Exceptions
Errors
Source Documentation and Comments
Idioms
Package management
Python 2 vs. Python 3

Advanced[edit | edit source]

Decorators
Context Managers
Reflection
Metaclasses
Namespace
Performance
PyPy
Cython
Command-line one-liners
Tips and Tricks

Modules[edit | edit source]

Standard library modules[edit | edit source]

Standard Library
Regular Expression
External commands
XML Tools
Email
Threading
Sockets
GUI Programming
Tkinter
CGI interface
WSGI web programming
Extracting info from web pages
Internet
Networks
Math

Third-party modules[edit | edit source]

Databases -- to be merged with the following chapter
Database Programming
numpy
Game Programming in Python
Qt4
Dbus
pyFormex
matplotlib
Sorted Container Types
Excel
MS Word

Writing extension modules[edit | edit source]

Extending with C
Extending with C++
Extending with Pyrex
Extending with ctypes
Extending with Perl

Appendices[edit | edit source]

Popularity
Links
Authors
Library Modules
Naming conventions

See also[edit | edit source]

Wikiversity has learning materials about Python