[Tutor] script in Raspberry pi python
Dave Angel
davea at davea.name
Thu Jul 25 20:19:53 CEST 2013
On 07/25/2013 01:02 PM, Kirk Bailey wrote:
>
> On 7/23/2013 9:42 PM, Amit Saha wrote:
>> On Wed, Jul 24, 2013 at 11:13 AM, Kirk Bailey
>> <kbailey at howlermonkey.net> wrote:
>>> Python works fine in pi. script works fine IF I invoke it high church:
>>> python ./RR.py
>>>
>>> but this fails: ./RR.py
>>> the shebang is
>>> #!/usr/bon/python
>> bon -> bin
> right.
Take a look at that file with a hex viewer. If you edited in Windows,
it'll probably have 0d0a line endings. Those do NOT work with a shebang
line. If that's the problem, then you can use dos2unix or equivalent
utility to fix it up. Or your favorite Linux editor.
If that's still not it, then how about using copy/paste to show us
exactly what's happening. "Fails" is not very descriptive. Show us the
console screen for something like:
cat RR.py
#!/usr/bin/python
print("Hello world")
./RR.py
As-many-as-5-lines-of-traceback error message, if it's a Python
exception, and something different if it's a bash error.
--
DaveA
More information about the Tutor
mailing list