problem with matplotlib in script

Hi,

running a python-script using matplotlib I get the following error message:

sh: mc: line 1: syntax error: unexpected end of file
sh: error importing function definition for `mc'
sh: mc: line 1: syntax error: unexpected end of file
sh: error importing function definition for `mc'

The script starts with a simple example:

...
from pylab import *

fig = figure(1)
plot([1,2,3])
close(fig)

...

Using matplotlib from IPython works fine. The script above has been invoked
via Pydev

Thanks in advance,

Chris

···

============================
M.Sc. Christoph Scheit
Institute of Fluid Mechanics
FAU Erlangen-Nuremberg
Cauerstrasse 4
D-91058 Erlangen
Phone: +49 9131 85 29508

Christoph Scheit ha scritto:

Hi,

running a python-script using matplotlib I get the following error message:

sh: mc: line 1: syntax error: unexpected end of file
sh: error importing function definition for `mc'
sh: mc: line 1: syntax error: unexpected end of file
sh: error importing function definition for `mc'

Your errors come from the shell interpreter. It seems that sh, and not python, is parsing the script.
Add the following line at the start:
#!/usr/bin/env python

and try again.

m.

···

--
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"

snail mail:
Via Irnerio 48, 40126 Bologna, Italy

email:
massimo.sandal@...898...

tel: +39-051-2094388
fax: +39-051-2094387