Dies ist die Support Website des Buches:: Das Python Praxisbuch Der große Profi-Leitfaden für Programmierer Farid Hajji Addison Wesley / Pearson Education ISBN 978-3-8273-2543-3 (Sep 2008), 1298 Seiten. ************************ 1. Python installieren ************************ Python auf Unix =============== URLs: * http://www.python.org/download/ (die Download-Area für CPython) * http://www.python.org/download/releases/2.5.2/ (die im Buch verwendete Version) Python ohne root-Rechte installieren ------------------------------------ URLs: * http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tar.bz2 (die im Buch benutzte Version) Python auf Windows ================== URLs: * http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi (der im Buch benutzte Installation Wizard) Screenshots: * `Download-Area von http://www.python.org/ `_. * `Die Auswahl eines Zielverzeichnisses `_. * `Wir installieren alles (keine Komponenten abwählen) `_. * `Compile .py files to byte code after installation `_. * `Python compiliert gerade die .py-Dateien `_. * `Das Python-Menü nach erfolgter Installation `_. Mehrere Python unter einem Dach =============================== Drittanbietermodule installieren ================================ Einfache .py Dateien -------------------- distutils-kompatible Packages ----------------------------- URLs: * `Installing Python Modules `_ Packages ohne root-Rechte installieren -------------------------------------- `sys.path` erweitern um Module aus einem Custom-Verzeichnis :file:`$HOME/python.3rd` importieren zu können:: #!/usr/bin/env python # Some program using custom modules. # 0. Compute $HOME/python.3rd in a platform-independant manner: import sys, os, os.path HOME=os.environ['HOME'] PACKAGEDIR=os.path.join(HOME, 'python.3rd') # 1. Prepend $HOME/python.3rd to sys.path: sys.path.insert(0, PACKAGEDIR) # OR: # 1bis. Append $HOME/python.3rd to sys.path: # sys.path.append(PACKAGEDIR) # 2. Now import standard and custom modules: import pprint # a standard module import mymodule2 # some custom module from $HOME/python.3rd # 3. Finally use the module in your code mymodule2.some_function() URLs: * `Modifying Python's Search Path `_ setuptools, Eggs und ein Käse-shop ================================== setuptools installieren ----------------------- URLs: * `Distributing Python Modules (with distutils) `_ * `Die setuptools Homepage `_ * `Das Bootstrap Programm ez_setup.py `_ * `Die im Buch verwendete setuptools Version `_ (wurde von :file:`ez_setup.py` automatisch geladen) setuptools unter Unix installieren ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ setuptools unter Windows installieren ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Screenshots: * `Die Variable Path erweitern `_ * `Environment Variables, dann Path selektieren `_ * `Auf Edit klicken `_ * `Ein Test ob alles gut gelaufen ist in der DOS-Box `_ URLs: * `MinGW Homepage `_ (GNU C++ Compiler für Windows) Diese Datei nach :file:`\\Python25\\Lib\\distutils\\distutils.cfg` verschieben: .. literalinclude:: ../att/pythoninstall/distutils.cfg `distutils.cfg `_ Screenshots: * `Eine Full Installation von MinGW `_ * `Den Zielfolder für MinGW auswählen `_ Wir testen unser MinGW-Setup mit folgender C++ Datei: .. literalinclude:: ../att/pythoninstall/helloworld.cpp :language: c++ `helloworld.cpp `_ Ein Käse-Shop mit vielen Leckereien ----------------------------------- URLs: * `Python Cheese-Shop `_ * `Perl CPAN `_ ZODB3 mit easy_install hinzufügen --------------------------------- URLs: * `ZODB3-3.8.0.tar.gz `_ (die im Buch mit ``easy_install ZODB3`` installierte Version von ZODB. Weitere Dependencies werden nachgeladen) easy_install benutzen --------------------- URLs: * `Die Man-Page von easy_install `_ Was sind Eggs? -------------- URLs: * `Dokumentation zu Python Eggs `_ Zusammenfassung ===============