background preloader

Learn Python

Facebook Twitter

Dive Into Python. The Python Standard Library — Python v2.7 documentation. While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python.

The Python Standard Library — Python v2.7 documentation

It also describes some of the optional components that are commonly included in Python distributions. Python’s standard library is very extensive, offering a wide range of facilities as indicated by the long table of contents listed below. The library contains built-in modules (written in C) that provide access to system functionality such as file I/O that would otherwise be inaccessible to Python programmers, as well as modules written in Python that provide standardized solutions for many problems that occur in everyday programming. Some of these modules are explicitly designed to encourage and enhance the portability of Python programs by abstracting away platform-specifics into platform-neutral APIs.

Instant Hacking. This is a short introduction to the art of programming, with examples written in the programming language Python.

Instant Hacking

(If you already know how to program, but want a short intro to Python, you may want to check out my article Instant Python.) This article has been translated into Italian, Polish, Japanese, Serbian, Brazilian Portuguese, Dutch, Czech, and Belarusian. This page is not about breaking into other people’s computer systems etc. I’m not into that sort of thing, so please don’t email me about it.

Note: To get the examples working properly, write the programs in a text file and then run that with the interpreter; do not try to run them directly in the interactive interpreter — not all of them will work. To program in Python, you must have an interpreter installed. Programming a computer means giving it a set of instructions telling it what to do.

Of course, no computer would understand this… And most computers wouldn’t be able to make a salad even if they did understand the recipe. Learning to program. Mark Lutz's Python Links Page. What's Python?

Mark Lutz's Python Links Page

Python is a free, general purpose, open source, computer programming language. It is optimized for software quality, developer productivity, program portability, and component integration. Among Python's features are a powerful multiparadigm toolset, with support for procedural, object-oriented, and functional programming; a remarkably simple, readable, and maintainable syntax; integration with external components; and a vast collection of precoded libraries and utilities. Today, Python's speed of development is leveraged by hundreds of thousands of programmers around the world, in diverse roles such as Internet scripting, systems administration, scientific programming, product customization, instrumentation, data mining, and more.

By most accounts, it now ranks as one of the top 5 to 10 most widely-used programming languages in the world. Although general-purpose, Python is often called a scripting language. Hands-On Python A Tutorial Introduction for Beginners. Hands-On Python A Tutorial Introduction for Beginners Contents Chapter 1 Beginning With Python 1.1.

Hands-On Python A Tutorial Introduction for Beginners

You have probably used computers to do all sorts of useful and interesting things. 1.1.1. First let us place Python programming in the context of the computer hardware. Z = x+y is an instruction in many high-level languages that means something like: Access the value stored at a location labeled x Calculate the sum of this value and the value stored at a location labeled y Store the result in a location labeled z.

No computer understands the high-level instruction directly; it is not in machine language. Obviously high-level languages were a great advance in clarity!