Interpreter problem

Greg Lindstrom greg.lindstrom at novasyshealth.com
Fri Apr 8 09:19:52 EDT 2005


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               greg.lindstrom at novasyshealth.com
Little Rock, Arkansas

"We are the music makers, and we are the dreamers of dreams."  W.W.

Confidentiality Notice
----------------------
This email and any attachments to it are privileged and confidential and are intended solely for use of the individual or entity to which they are addressed. If the reader of this message is not the intended recipient, any use, distribution, or copying of this communication, or disclosure of all or any part of its content to any other person, is strictly prohibited. If you have received this communication in error, please notify the sender by replying to this message and destroy this message and delete any copies held in your electronic files. Thank you.




More information about the Python-list mailing list