Newbie Question

Steve Holden sholden at holdenweb.com
Mon Apr 16 08:08:24 EDT 2001


"Steve Purcell" <stephen_purcell at yahoo.com> wrote in message
news:mailman.987411262.29310.python-list at python.org...
> Gregory T. Weber wrote:
> > I just started with the Learning Python book and was not able to get one
> > of the simplest programs working.  I suspect that the installation
> > is at fault and want to confirm before going any further.  Using Python
2.0 on Solaris 2.6.
> >
> > The code is
> >
> > #! /usr/bin/python
> >
> > print 'First Program'
> >
> > At the command line this works fine
> >
> > > python first.py
> > First Program
> >
> > After making first.py executable I figured I could do this
> >
> > >first.py
> >
> > but I get the error
> >
> > print: Command not found.
>
>
>
> Here's a hint:
>
>    tcsh% print 'First Program'
>    print: Command not found.
>
>
> The problem appears to lie in the '#!' line -- your shell is ignoring it
> and trying to run the script itself.
>
> Try changing the first line to '#!/usr/bin/python'.
>
For a slightly more general discussion of this problem, see the FAQ:

"4.63. How do I make a Python script executable on Unix?"

regards
 Steve






More information about the Python-list mailing list