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.
2. Die Python-Shell¶
Die Qual der (Python-Shell-) Wahl¶
Python-Shells unter Unix¶
URLs:
- Emacs Homepage
- Emacs python-mode
- IPython Homepage
- Die im Buch verwendete Version von IPython (mit
easy_install ipython
automatisch geladen)
Um den Python-Mode von Emacs zu nutzen, tragen Sie Folgendes
in Ihre ~/.emacs
Datei ein.
;; Add python-mode
(autoload 'python-mode "python-mode" "Python editing mode." t)
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(add-hook 'python-mode-hook 'turn-on-font-lock)
Screenshots:
Python-Shells unter Windows¶
URLs:
- IPython benötigt pyreadline unter Windows (benutzen Sie den Binary Installer von
pyreadline
). - Der Notepad++ Editor (mit Syntax-Highlighting, nicht nur für Python nützlich!)
Screenshots:
Ein Taschenrechner¶
#!/usr/bin/env python
# demoshell.py -- import this into a python shell.
import math
radius = 10.0
circumference = 2 * math.pi * radius
def circ(rad):
"compute the circumference of a circle of radius rad."
return 2 * math.pi * rad
Auf Erkundungstour¶
Introspektion mit dir, type und __doc__¶
Das Dokumentationstool pydoc¶
Screenshots: