Python
Python ist eine universelle höhere Programmiersprache. Das Charakteristische an Python ist die Einrückung von Codeblöcken, was die Programmlesbarkeit erhöht. Mit Python kann man sowohl objektorientiert als auch prozedural (funktional) programmieren. Wie andere dynamische Sprachen, wird Python oft als Skriptsprache genutzt, beispielsweise in Office-Software (OpenOffice.org), Grafikprogrammen (Blender, Cinema 4D, Maya, GIMP) und in der Statistiksoftware SPSS - und nicht zuletzt in QGIS und ArcGIS.
Siehe auch:
Inhaltsverzeichnis
Dokumentation
Online-Dokumentation für Neueinsteiger:
- "Programmieren lernen" von Alan Gauld
- "A Byte of Python" (deutsche Übersetzung) - Original-Version von Swaroop C H
- Google's Python Class - An online introduction to Python programming, including writen materials, lecture videos, and coding exercises.
Bücher
Python:
- für Einsteiger:
- Python for Software Design - How to Think Like a Computer Scientist by Allen B. Downey, Online-Version - Gute Erklärung der Python-Grundlagen
- Learning Python, Mark Lutz - Ein gutes Buch für Pythonanfänger.
- Head First Programming Python, Griffiths, David und Paul Barry - Zu verspieltes Layout, zu grosse Bilder.
- Python for Dummies, Maruch Stef und Aahz Maruch: - guter Aufbau, Icon für Tipps ect..
- verschiedenes:
- Dive into Python - Online-Version - Für Fortgeschrittene oder Umsteiger, beinhaltet interessante Zusatzthemen wie Web Services.
- Python in a Nutshell, Martelli Alex - Gutes Buch, umfangreiche Beschreibung
- Python Essential Reference, David M. Beazley - Gute Python Referenz.
Python zusammen mit weiteren Technologien:
- Rapid GUI Programming with Python and Qt, Summerfield, Mark - Gutes Buch zu PyQt 4, Python und QT wird auch erklärt.
Python installieren und editieren
Installation Python
Installation Python unter Windows:
- Installiere Python mit dem MSI-Installer. Die stabilste Windows Version ist Python 2.6.4. Hier der Link zum Installer: http://www.python.org/ftp/python/2.6.4/python-2.6.4.msi
- Andere Versionen sind unter http://www.python.org/download/ downloadbar.
- Hinweis: Diejenigen, die QGIS installiert haben (v.a. über den OSGeo-Installer) sollten kontrollieren, ob Python nicht bereits installiert ist.
Installation Python unter Unix:
- Die meisten Linux-Distributionen haben Python schon installiert. Wird eine neuere Version gebraucht, kann man diese aus den Sourcen bilden. http://www.python.org/download/
- Für Red Hat, installiere python2 und python2-devel Pakete.
- Für Debian oder Ubuntu, installiere python2.6 und python2.6-dev Pakete.
- Für Gentoo, installiere das '=python-2.x*' ebuild. http://www.gentoo.org/proj/en/Python/
- Für andere Systeme, bilde Python über die Sourcen. http://www.python.org/download/
Python-Editoren und IDEs
Zum Editieren und als Entwicklungsumgebung (integrated development environments, IDE) empfehlen wir Eclipse mit pyDev:
- Eclipse mit pyDev-Plugin: (Unix, Windows, Mac OS X), vollständige IDE u.a. mit Code-Vervollständigung und Refactoring.
- Installation: http://eclipse.org und http://pydev.org/manual_101_install.html
- Python Development with PyDev and Eclipse - Tutorial
Ansonsten haben wir über folgende Editoren gutes gehört (und gelesen):
- Komodo Edit (Unix, Windows, Mac OS X): Open Source-Version von "Komodo IDE". http://www.activestate.com/komodo_edit/
- PyPE: Übersichtlicher Editor. http://pype.sourceforge.net/index.shtml
- Eric4: Einfach und doch viele Funktionen, selber in Python geschrieben. Etwas aufwändig zu installieren. http://eric-ide.python-projects.org/
- Jedit mit JpyDbg-Plugin: einfacher Editor mit Python-Plugin. http://jedit.org
- PythonWin (Windows only): mit Debugger, bei ArcGIS-User verbreitet, keine Code-Vervollständigung.
- IDLE: Im Python-Paket enthaltener Editor. Etwas gewöhnungsbedürftig, aber mit vielen Features wie: syntax highlighting, autocompletion und debugging.
- SPE IDE - Stani's Python Editor: http://pythonide.blogspot.com/
Python und Webframeworks
- GeoDjango: GIS-Erweiterung des Webframeworks Django. Ermöglicht die Verwaltung von Geodaten und dadurch die Erfassung von Objekten direkt im Browser.
Python und GIS-Desktop-Systeme
Python-Programmierung mit QGIS:
Python-Programmierung mit ArcGIS:
- Lecture "GIS Programming with Python" von John Lowry e al.
- "A Guide to the Python Universe for ESRI".
- Kurse z.B. bei ESRI Suisse in Zürich.
Geoprocessing with Python using Open Source GIS:
- Lecture/Module by Chris Garrard, Univ. Utah
- Uses GDAL/OGR und Crimson Text Editor on Windows; see http://www.gis.usu.edu/~chrisg/python/
- The primary site for Python GDAL is http://trac.osgeo.org/gdal/wiki/GdalOgrInPython (Windows: http://pypi.python.org/pypi/GDAL/ ), other examples: http://www.pygis.de/index.php/GDAL
Python und Geoprocessing-Services
Geoprocessing mit Python:
- Geoprocessing mit PostGIS: Siehe z.B. "Geoprocessing von Massendaten in PostGIS", FOSSGIS2010. [1].
- Geoprocessing mit Python: Siehe z.B. "Geoprocessing with Python using Open Source GIS" by Chris Garrard, Utah State University, [2].
WPS:
- PyWPS Web Processing Service ([3]): PyWPS is a Python program which implements the OGC WPS 1.0.0 standard (with a few omissions). PyWPS has a low footprint, making it easy to install. Python was considered a good choice of implementation language as it is a very easy language to develop in and allows partners to easily integrate existing processing which may have been written in other languages.
- WebProcessingServer ([4])
Weblinks
- Python Cookbook - A collection of the Python "recipes"
- The official website for the Python language: python.org
- The Python Tutorial