Python: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
K (Python-Editoren und IDEs)
 
(83 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
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:
+
Siehe auch [[Python - Tipps und Tricks]] und [[Kurse]].
* [[QGIS]]
 
* [[ArcGIS]]
 
  
 
== Dokumentation ==
 
== Dokumentation ==
  
für Neueinsteiger:
+
Python Weblinks:
 +
* http://www.python.org
 +
* http://www.zope.com/
 +
* http://www.pythonlabs.com/
 +
* [http://www.vex.net/parnassus/ Vaults of Parnassus: Python Resources]
 +
* '''[http://michaelgoerz.net/refcards/python_refcard.pdf Python 2.5 Reference Card]''' by  Michael Goerz (2009).
 +
 
 +
Online-Lernmaterial für Neueinsteiger:
 
* [http://www.freenetpages.co.uk/hp/alan.gauld/german/index.htm "Programmieren lernen" von Alan Gauld]
 
* [http://www.freenetpages.co.uk/hp/alan.gauld/german/index.htm "Programmieren lernen" von Alan Gauld]
 +
* [http://abop-german.berlios.de/ "A Byte of Python" (deutsche Übersetzung) - Original-Version von Swaroop C H]
 +
* [http://code.google.com/intl/de-DE/edu/languages/google-python-class/ Google's Python Class] - An online introduction to Python programming, including writen materials, lecture videos, and coding exercises.
 +
 +
== Online-Bücher und -Artikel ==
 +
 +
Online-Bücher:
 +
* für Einsteiger (empfohlen):
 +
** ''Python for Software Design - How to Think Like a Computer Scientist'' by Allen B. Downey, [http://www.greenteapress.com/thinkpython/ Online-Version] - Gute Erklärung der Python-Grundlagen
 +
** ''Learning Python'', Mark Lutz - Ein gutes Buch für Pythonanfänger.
 +
** ''Dive into Python'' - [http://www.diveintopython.org/ Online-Version] - Für Fortgeschrittene oder Umsteiger, beinhaltet interessante Zusatzthemen wie Web Services.
 +
** ''Python for Dummies'', Maruch Stef und Aahz Maruch: - guter Aufbau, Icon für Tipps etc..
 +
* für Einsteiger (weitere):
 +
** [http://learnpythonthehardway.org/static/LearnPythonTheHardWay.pdf Learn Python The Hard Way] (.pdf)
 +
** [http://www.freenetpages.co.uk/hp/alan.gauld/ Learning to program]
 +
** [http://www.greenteapress.com/thinkpython/ How to Think Like a Computer Scientist]
 +
** [http://www.mindview.net/Books/TIPython Thinking in Python] - Bruce Eckel's Mindview
 +
** [http://www.galileocomputing.de/openbook/python/ Das umfassende Handbuch] - Galileo Design Openbook (Python 2.5?)
 +
** (''Head First Programming Python'', Griffiths, David und Paul Barry - Zu verspieltes Layout, zu grosse Bilder).
 +
* Zum Nachschlagen:
 +
** ''Python in a Nutshell'', Martelli Alex - Gutes Buch, umfangreiche Beschreibung
 +
** ''Python Essential Reference'', David M. Beazley - Gute Python Referenz.
 +
 +
Online-Artikel:
 +
* [http://devshed.com/Server_Side/Python All about Python] auf Devshed.com
 +
* [http://www.devarticles.com/art/1/299 Python: the other Scripting Language that starts with "P"] auf devArticles.com
 +
* [http://www.hotscripts.com/Python/ The Python Section] auf Hotscripts.com
 +
 +
== Python installieren ==
 +
 +
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 '''PyCharm''' oder '''PyDev''' (mit Eclipse oder Aptana Studio).
 +
* PyDev for Eclipse : (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
 +
** [http://www.vogella.de/articles/Python/article.html Tutorial]
 +
* PyDev for Aptana Studio: http://aptana.com/products/studio2 (Python highlighting fehlt).
 +
* Multiplatform (Unix, Windows, Mac OS X):
 +
** PyCharm IDE: [http://www.jetbrains.com/pycharm/]. Multiplatform. Sehr gute IDE mit Refactoring etc. (von den Machern der etablierten IntelliJ Java IDE aus Tschechien), aber kommerziell mit 30-Tage Trial bzw. mit freier akad. Lizenz.
 +
** JpyDbg for Netbeans: http://jpydbg.sourceforge.net/
 +
** PythonWin (Windows only): mit Debugger, keine Code-Vervollständigung, oft mit grösseren Paketen dabei (z.B. ArcGIS).
 +
 +
Ansonsten haben wir über folgende Editoren Gutes gehört und gelesen:
 +
* www.pythonanywhere.com
 +
* Weitere Editoren:
 +
** IDLE: Im Python-Paket enthaltener Editor. Etwas gewöhnungsbedürftig, aber mit vielen Features wie: syntax highlighting, autocompletion und debugging.
 +
** eric4 (für Python 2) und eric5 (für Python 3): Einfach und doch viele Funktionen, in Python und Qt geschrieben. Etwas aufwändig zu installieren, da nebst Python Qt, PyQT sowie QSintilla vorausgesetzt wird. http://eric-ide.python-projects.org/
 +
** Komodo Edit: Open Source-Version von "Komodo IDE". http://www.activestate.com/komodo_edit/
 +
** PyScripter - http://code.google.com/p/pyscripter/wiki/PyScripter
 +
** SPE IDE - Stani's Python Editor: http://pythonide.blogspot.com/
 +
* Text/Programmier-Editoren;
 +
** JEdit mit JpyDbg-Plugin: Umfangreicher Programmier-Editor mit Python-Plugin. http://jedit.org
 +
* Veraltet:
 +
** PyPE: Übersichtlicher Editor. http://pype.sourceforge.net/ (last update 2009-12-29!)
 +
 +
== Python Programming... ==
 +
 +
Webframeworks:
 +
* [http://geodjango.org/ GeoDjango]: GIS-Erweiterung des Webframeworks Django. Ermöglicht die Verwaltung von Geodaten und dadurch die Erfassung von Objekten direkt im Browser.
 +
 +
Python Documentation Tools:
 +
* [http://sphinx.pocoo.org/ Sphinx] (u.a. verwendet in FeatureServer)
  
Bücher:
+
== Python und GIS-Desktop-Systeme ==
* Dive into Python - [http://www.diveintopython.org/ Online-Version]
 
* Python in a Nutshell
 
* Learning Python
 
* Python Essential Reference
 
  
== Python-Programmierung mit QGIS ==
+
Python-Programmierung mit QGIS:
 
* Siehe [http://dev.ifs.hsr.ch/python4gis Python Programming for (Q)GIS].  
 
* Siehe [http://dev.ifs.hsr.ch/python4gis Python Programming for (Q)GIS].  
  
== Python-Programmierung mit ArcGIS ==
+
Python-Programmierung mit ArcGIS:
 
* Lecture [http://www.gis.usu.edu/~jlowry/python/ "GIS Programming with Python"] von John Lowry e al.  
 
* Lecture [http://www.gis.usu.edu/~jlowry/python/ "GIS Programming with Python"] von John Lowry e al.  
 
* "A Guide to the Python Universe for ESRI".
 
* "A Guide to the Python Universe for ESRI".
 
* Kurse z.B. bei ESRI Suisse in Zürich.
 
* Kurse z.B. bei ESRI Suisse in Zürich.
  
== Editoren ==
+
Geoprocessing with Python using Open Source GIS:
Editoren:
+
* Lecture/Module by Chris Garrard, Univ. Utah. Uses [[GDAL]]/[[OGR]] und Crimson Text Editor on Windows; see http://www.gis.usu.edu/~chrisg/python/
* Eclipse mit pyDev-Plugin: (Unix, Windows, Mac OS X), vollständige IDE u.a. mit Code-Vervollständigung und Reactoring.
+
* 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
** Installation: http://eclipse.org und http://pydev.org/download.html
+
 
**  Python Development with PyDev and Eclipse - [http://www.vogella.de/articles/Python/article.html Tutorial]
+
== Geoprocessing mit Python ==
* PythonWin: (Windows only), mit Debugger, bei ArcGIS-User verbreitet, keine Code-Vervollständigung.  
+
 
* Komodo Edit: Open Source-Version von "Komodo IDE" (Unix, Windows, Mac OS X)
+
Siehe [[Geoprocessing mit Python]].
  
 
== Weblinks ==
 
== Weblinks ==
* [http://aspn.activestate.com/ASPN/Python/Cookbook/ Python Cookbook] - A collection of the Python "recipies"
+
* [http://aspn.activestate.com/ASPN/Python/Cookbook/ Python Cookbook] - A collection of the Python "recipes"
 
* The official website for the Python language: [http://www.python.org/doc/ python.org]
 
* The official website for the Python language: [http://www.python.org/doc/ python.org]
 
* [http://www.python.org/doc/current/tutorial/ The Python Tutorial]
 
* [http://www.python.org/doc/current/tutorial/ The Python Tutorial]
 +
 +
[[Kategorie:Python]]

Aktuelle Version vom 6. April 2015, 01:01 Uhr

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 Python - Tipps und Tricks und Kurse.

Dokumentation

Python Weblinks:

Online-Lernmaterial für Neueinsteiger:

Online-Bücher und -Artikel

Online-Bücher:

  • für Einsteiger (empfohlen):
    • 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.
    • Dive into Python - Online-Version - Für Fortgeschrittene oder Umsteiger, beinhaltet interessante Zusatzthemen wie Web Services.
    • Python for Dummies, Maruch Stef und Aahz Maruch: - guter Aufbau, Icon für Tipps etc..
  • für Einsteiger (weitere):
  • Zum Nachschlagen:
    • Python in a Nutshell, Martelli Alex - Gutes Buch, umfangreiche Beschreibung
    • Python Essential Reference, David M. Beazley - Gute Python Referenz.

Online-Artikel:

Python installieren

Installation Python unter Windows:

Installation Python unter Unix:

Python-Editoren und IDEs

Zum Editieren und als Entwicklungsumgebung (integrated development environments, IDE) empfehlen wir PyCharm oder PyDev (mit Eclipse oder Aptana Studio).

  • PyDev for Eclipse : (Unix, Windows, Mac OS X), vollständige IDE u.a. mit Code-Vervollständigung und Refactoring.
  • PyDev for Aptana Studio: http://aptana.com/products/studio2 (Python highlighting fehlt).
  • Multiplatform (Unix, Windows, Mac OS X):
    • PyCharm IDE: [1]. Multiplatform. Sehr gute IDE mit Refactoring etc. (von den Machern der etablierten IntelliJ Java IDE aus Tschechien), aber kommerziell mit 30-Tage Trial bzw. mit freier akad. Lizenz.
    • JpyDbg for Netbeans: http://jpydbg.sourceforge.net/
    • PythonWin (Windows only): mit Debugger, keine Code-Vervollständigung, oft mit grösseren Paketen dabei (z.B. ArcGIS).

Ansonsten haben wir über folgende Editoren Gutes gehört und gelesen:

Python Programming...

Webframeworks:

  • GeoDjango: GIS-Erweiterung des Webframeworks Django. Ermöglicht die Verwaltung von Geodaten und dadurch die Erfassung von Objekten direkt im Browser.

Python Documentation Tools:

  • Sphinx (u.a. verwendet in FeatureServer)

Python und GIS-Desktop-Systeme

Python-Programmierung mit QGIS:

Python-Programmierung mit ArcGIS:

Geoprocessing with Python using Open Source GIS:

Geoprocessing mit Python

Siehe Geoprocessing mit Python.

Weblinks