Interpreter problem

Ruud de Jong look.at.signature at somewhere
Fri Apr 8 10:31:58 EDT 2005


Greg Lindstrom schreef:
> 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
> 
I remember encountering a similar problem once. It turned out that
the python interpreter, when invoked through the #! line, will only work 
properly if the line ends in a Unix newline (only a LF: '\n'). When you 
create the line on a Windows or Mac platform the line ending will 
typically be different: CR/LF (\r\n) for Windows, CR (\r) for Mac. For 
the body of the python script this doesn't matter, but it does matter 
for the #! line.
Not sure if this applies here, but who knows.

Good luck, Ruud
-- 
Ruud de Jong

'@'.join('.'.join(s) for s in (['ruud','de','jong'],['tiscali','nl']))



More information about the Python-list mailing list