[Tutor] Fwd: script in Raspberry pi python

Walter Prins wprins at gmail.com
Thu Jul 25 21:45:52 CEST 2013


Hi,



On 25 July 2013 19:45, Kirk Bailey <kbailey at howlermonkey.net> wrote:

>  which python
> /usr/bin/python
> root at KirksPiBox1:/home/pi: ./RR.py
> bash: ./RR.py: /usr/bin/python^M: bad interpreter: No such file or
> directory
> root at KirksPiBox1:home/pi:_
>

Dave's correct.  That "^M" represents ctlr-m, and is the displayable
equivalent of the "Carriage Return" character.  Windows text files uses
CR/LF (Carriage Return, Line Feed) characters to delimit lines of text in
text files. Unix uses only "Line Feed".  So the extra carriage return
character is taken to be part of the text at the end of the shebang line.
 And "/usr/bin/python" is not the same as "/usr/bin/python^M"

Here's some background:
http://mag-sol.com/articles/crlf.html

How and where did you create the file?  If with an editor, which editor?

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130725/190aac69/attachment.html>


More information about the Tutor mailing list