Python
From FrugalWiki
Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어
Contents |
Introduction
This entry will cover installing Python, and provide some references.
Installation
There are currently two versions of python: Python 2 (which is the default) and the next version, Python 3.
Python
Python
To install the latest version of Python 3, run:
Getting easy_install
The easy_install tool is available in the package python-distribute
Misc. Uses
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 - open a file urllib.urlopen - open a web page, import urllib first urllib.urlretrieve - download a file (by default, to /tmp, but a directory can be specified), import urllib first os.listdir - list all files in a given directory, import os first
You will find that Python is used frequently, in applications ranging from the GIMP, to Sage. Python's scalability, popularity, and ease of coding makes it an important addition to all desktops.
More Resources
- 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.
- A Byte of Python is a book suitable for users new to python (and scripting in general).
- Beginning Game Development with Python and Pygame: From Novice to Professional for games