Bad interpreter

Peter Hansen peter at engcorp.com
Wed May 26 09:46:15 EDT 2004


Benjamin Niemann wrote:

> Peter Hansen wrote:
>> Remove the hidden CR character which you got at the end of the
>> lines by moving the file to a Windows system and editing it. ;-)
>>
>> This one is pretty tricky to figure out the first few times...
> 
> Should be the other way 'round: If you edit the file under Windows (e.g. 
> with Notepad), (invisible) CRs are added. 

We're saying the same thing.  You call them invisible, I call
them hidden, and we're both saying they got added when he
edited the file under Windows.  If he were to open the file in, say,
"vi" instead, on Linux, it would display the ^M endings, no doubt,
at least if he entered ":set list" to display invisible characters.

> One way to fix this on a Linux/UNIX system would be:
> tr -d '[\r]' <script.py >fixed_script.py

Good idea.

-Peter



More information about the Python-list mailing list