|Summary help replacing me|
|This article explains how to install and configure Python.|
|Python Package Guidelines|
Python "is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Python is often compared to Tcl, Perl, Ruby, Scheme or Java."
There are currently two versions of Python: Python 3 (which is the default) and the older Python 2.
Python 3 is the latest version of the language, and is incompatible with Python 2. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places. For an overview of the differences, visit Python2orPython3 and their relevant chapter in Dive into Python 3.
If you would like to build the latest RC/betas from source, visit Python Downloads. The Arch User Repository also contains good PKGBUILDs. If you do decide to build the RC, note that the binary (by default) installs to
Python 2 will happily run alongside Python 3. You need to specify python2 in order to run this version.
Any program requiring Python 2 needs to point to
/usr/bin/python2, instead of
To do so, open the program or script in a text editor and change the first line.
The line will show one of the following:
In both cases, just change
python2 and the program will then use Python 2 instead of Python 3.
Integrated Development Environments
There are some IDEs for Python available in the official repositories.
For the latest Python 3 compatible version, install the package.
Version 4 of Eric is Python 2 compatible and can be installed with thepackage.
These IDEs can also handle Ruby.
The Ninja IDE is provided by the package.
Spyder (previously known as Pydee) is a powerful interactive development environment for the Python language with advanced editing, interactive testing, debugging and introspection features. It focuses on scientific computations, providing a matlab-like environment. It can be installed with the package
The easy_install tool is available in the packageor .
Python is excellent for emergency situations, or when you simply need to work with files without writing any Perl, Bash, or C. Here are some functions that I have found to be helpful (although this is by no means a comprehensive list);
- open a file
- open a web page,
- download a file (by default, to
/tmp, but a directory can be specified),
- list all files in a given directory,
You will find that Python is used frequently, in applications ranging from the GIMP, to Sage. Python's scalability, popularity, and ease of coding make it an important addition to all desktops.
The following widget toolkit bindings are available:
- http://wiki.python.org/moin/TkInter || standard module
To use these with Python, you may need to install the associated widget kits.
- Learning Python is one of the most comprehensive, up to date, and well-written books on Python avavilable today.
- Dive Into Python is an excellent (free) resource, but perhaps for more advanced readers and has been updated for Python 3.
- A Byte of Python is a book suitable for users new to Python (and scripting in general).
- Learn Python The Hard Way the best intro to programming.
- facts.learnpython.org nice site to learn python.
- 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.
- Beginning Game Development with Python and Pygame: From Novice to Professional for games
Try the following snippets from Python's interactive shell:
>>> import this
>>> from __future__ import braces
>>> import antigravity