[Tutor] pychart and debian

nephish nephish at xit.net
Mon Sep 19 05:44:54 CEST 2005


Danny Yoo wrote:

>>ok, got the package installed, but it seems to not be working, or the
>>examples are messed up.
>>here is the source
>>
>>from pychart import *
>>theme.get_options()
>>data = [["Jan", 10], ["Feb", 22], ["Mar", 30]]
>>
>>ar = area.T(x_coord = category_coord.T(data, 0),
>>            y_range = (0, None),
>>            x_axis = axis.X(label="Month"),
>>            y_axis = axis.Y(label="Value"))
>>ar.add_plot(bar_plot.T(data = data, label = "Something"))
>>ar.draw()
>>
>>and here is what i get when i run it.
>>
>>from: can't read /var/mail/pychart
>>    
>>
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>Ah!  You're running into an issue with your Unix environment, not Python.
>
>Unix doesn't care about file names: without any hints, it'll think that
>your program is a mere shell script.  The error message above means that
>'/bin/sh' is trying to interpret your program.  That is, it's trying to
>run the Unix 'from' command!
>
>http://www.freebsd.org/cgi/man.cgi?query=from&apropos=0&sektion=0&manpath=FreeBSD+5.4-RELEASE+and+Ports&format=html
>
>And the subsequent error messages are pretty much '/bin/sh' error
>messages.
>
>
>To avoid this problem, try:
>
>    $ python categbar.py
>
>Alternatively, make sure the first line in your Python program contains
>the "magic" line:
>
>    #!/usr/bin/env python
>
>to tell the Unix (or Linux) kernel that the program you're running is
>meant to be run through Python.
>
>
>  
>
yup, the examples did not have the #!/usr/bin/python line.
i have been at python for about 5 months now. How did i miss this?

thanks
sk


More information about the Tutor mailing list