Joe VanAndel's Python Resource Page
Introduction to Python
Python is an interpreted object oriented
programming language with a rich set of extensions. I use it for developing
and testing algorithms that process gigabytes of weather radar data.
Useful extensions
- Numeric Python
adds a fast, compact multidimensional array language facility to Python.
Using Numerical Python and extensions I've written, I can efficiently process
gigabytes of radar data, with the flexibility of an interpreted lanaguage.
Although not as slickly packaged as IDL or MATLAB, I find Numeric Python very
powerful.
- contains many useful math operations, sin(), cos(), FFT
- supports netCDF I/O
- for efficiency, users can write their own specialized extensions
in C/C++
- PyGTK - Python Bindings
for the GTK Widget Set PyGTK is a set of bindings for the
GTKwidget set. It provides an object
oriented interface that is slightly higher level than the C one. GTK
is the toolkit used by Gnome. Although it is mostly used with the X
window system, it is now available for Microsoft Windows, as well.
- Python
Bindings for GtkExtra. GtkExtra is a useful set of widgets for theGIMP Toolkit. It provides a spreadsheet-like
matrix widget, widgets for 2-D and 3-D graphing and several other widgets.
You can find more information, download the source code and view screenshots
on theGtkExtra Widget Set Home
Page.
- Pyro.
Python Remote Objects. Sometimes it is necessary to build a multi-process
python application. For example, I did not want to tie up my GUI application
performing lengthy calculations, but wanted to have the calculations performed
by another process. Pyro makes it quite easy to communicate with another
process using Remote Procedure Calls. In fact, the procedure
calling a remote method does not know whether the procedure is executed locally
or remotely.
- netCDF
interface to Unidata's netCDF
library
- DORADE sweepfile I/O
Interfacing C/C++ to Python
Python is most useful to me because I can write my own C/C++ extensions for
specialized I/O or to perform an "expensive" operation. Presently,
I use SWIG to help me build my extensions, however there are other tools
worth investigating:
- SWIG builds wrapper code to interface
C/C++ to Python, based on a interface specification file. SWIG makes
it easier to write an extension in C/C++, but even if you are writing C++,
the extension code still uses the low-level C interface to Python (reference
counting and all.)
- Despite its name, f2py
can be used to wrap C code.
- Scipy.weave allows
the inclusion of C/C++ within Python code. See the performance results
at the bottom of this
page.
- Boost.Python is
designed to interface C++ to Python. It offers support for Numeric
arrays.
Useful tools
- WingIDE is an excellent IDE and
source level debugger for Python. It is a commercial product, but very
reasonably priced. ($45 for non-profit educational use, $99 for commercial
use.) Highly recommended.
- [X]Emacs has a python editing mode.
- Glade is a free user interface builder
for GTK applications. You should use LibGlade
and the support in gnome-python to create the widgets you specified with Glade.
Here's a useful
tutorial on developing Gnome applications with Python and Glade. GladeBaseis
a useful addon that implements a Model-View-Controller interface. The
author of GladeBase also wrote a tutorial(in PowerPoint)
explaining how to use Glade.
Helpful Internet Resources
Worth investigating: