G
Greg Lindstrom
I am using python 2.3.5 on a Linux system and have an odd problem
dealing with the 'sha-bang' line. I have a file, driver.py which starts
with
#!/usr/bin/python
and works fine (that is, when I type in ./driver.py at the command
prompt the file runs as expected). I have another file, myotherfile.py
which starts with the exact same line (#!/usr/bin/python) but I get
: bad interpreter: No such file or directory
Hmmmm. That occurs when I have no trailing spaces after the word
'python' on the first line. When I place a single space at the end of
the line I get:
usr/bin/python: can't open file (note the lack of a slash at the
start of the line...is that significant?)
In the 2nd file I placed import sys on line 2, then sys.exit(0) on line
3 to isolate the behavior, so I'm pretty sure the problem deals with
the first line of the file.
If I remove the import sys and sys.exit(0) then type ./myotherfile.py at
the command line it runs as expected. Both files have the same
permission settings (744) and owner (me). I'm been looking at this for
a couple of days and am at a loss. Have any of you seen anything like
this and what can I do about it?
Thanks,
--greg
--
Greg Lindstrom 501 975.4859 (office)
Senior Programmer 501 219-4455 (fax)
NovaSys Health (e-mail address removed)
Little Rock, Arkansas
"We are the music makers, and we are the dreamers of dreams." W.W.
Confidentiality Notice
dealing with the 'sha-bang' line. I have a file, driver.py which starts
with
#!/usr/bin/python
and works fine (that is, when I type in ./driver.py at the command
prompt the file runs as expected). I have another file, myotherfile.py
which starts with the exact same line (#!/usr/bin/python) but I get
: bad interpreter: No such file or directory
Hmmmm. That occurs when I have no trailing spaces after the word
'python' on the first line. When I place a single space at the end of
the line I get:
usr/bin/python: can't open file (note the lack of a slash at the
start of the line...is that significant?)
In the 2nd file I placed import sys on line 2, then sys.exit(0) on line
3 to isolate the behavior, so I'm pretty sure the problem deals with
the first line of the file.
If I remove the import sys and sys.exit(0) then type ./myotherfile.py at
the command line it runs as expected. Both files have the same
permission settings (744) and owner (me). I'm been looking at this for
a couple of days and am at a loss. Have any of you seen anything like
this and what can I do about it?
Thanks,
--greg
--
Greg Lindstrom 501 975.4859 (office)
Senior Programmer 501 219-4455 (fax)
NovaSys Health (e-mail address removed)
Little Rock, Arkansas
"We are the music makers, and we are the dreamers of dreams." W.W.
Confidentiality Notice