Interpreter problem
rbt
rbt at athop1.ath.vt.edu
Fri Apr 8 11:41:39 EDT 2005
Steve Holden wrote:
> rbt wrote:
>
>> Steve Holden wrote:
>>
>>> Greg Lindstrom wrote:
>>>
>>>> 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
>>>>
>>> There's almost certainly a carriage return as well as a newline in
>>> the shebang line.
>>>
>>> [...]
>>>
>>> regards
>>> Steve
>>
>>
>>
>> Not so. I get the same result with python 2.3 and 2.4 on Debian Linux
>> Testing. Nothing odd at all in the shebang.
>
>
> What, you are telling me you've checked the file with a command like
>
> head driver.py | od -bc
>
> and verified the absence of any extraneous characters?
>
> regards
> Steve
You're right:
rbt at athop1:~$ cd /usr/local/bin
rbt at athop1:/usr/local/bin$ head web* | od -bc
0000000 043 041 057 165 163 162 057 142 151 156 057 160 171 164 150 157
# ! / u s r / b i n / p y t h o
0000020 156 015 012 144 145 146 040 167 145 142 137 142 141 143 153 165
n \r \n
How can this be fixed? vim doesn't see it.
More information about the Python-list
mailing list