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:

Python ohne root-Rechte installieren

URLs:

Mehrere Python unter einem Dach

Drittanbietermodule installieren

Einfache .py Dateien

distutils-kompatible Packages

URLs:

Packages ohne root-Rechte installieren

sys.path erweitern um Module aus einem Custom-Verzeichnis $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:

setuptools, Eggs und ein Käse-shop

setuptools installieren

URLs:

setuptools unter Unix installieren

setuptools unter Windows installieren

Screenshots:

URLs:

Diese Datei nach \Python25\Lib\distutils\distutils.cfg verschieben:

[build_ext]
compiler = mingw32

distutils.cfg

Screenshots:

Wir testen unser MinGW-Setup mit folgender C++ Datei:

// helloworld.cpp -- Hello, World in C++

#include <iostream>

int main()
{
  std::cout << "Hello, World!" << std::endl;
}

helloworld.cpp

Ein Käse-Shop mit vielen Leckereien

URLs:

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:

Was sind Eggs?

URLs:

Zusammenfassung