ucs2 and ucs4 python

Dave Angel d at davea.name
Wed May 16 05:54:30 EDT 2012


On 05/16/2012 05:20 AM, zayatzz wrote:
> On May 16, 11:50 am, Matej Cepl <mc... at redhat.com> wrote:
>> On 16.5.2012 10:36, zayatzz wrote:
>>
>>> /opt/bin/python^M: bad interpreter: No such file or directory
>> Your script has CRLF end-of-lines. Change it to plain Unix LF.
>>
>> Matěj
> Thanks :) but i have no idea what that means or how to achieve that.
>
> Alan

See in the echo of the shebang line the "^M" at the end ?  That's a
carriage return, hex(0d).  Unix/Linux use a single linefeed (hex(0a)) at
the end of the line.  At some point, you probably edited this file with
a Windows (aka DOS) editor, and it used the CRLF form (hex(0d0a)),
carriage return/line feed at the end of each line.

Your Linux text editor probably has a menu option to convert them back
to simple linefeeds, but if not, your Linux/Unix probably has a utility

    dos2unix

which can do the job.



-- 

DaveA




More information about the Python-list mailing list