Hi, Le Sat, 12 Jan 2008 20:30:25 -0800 (PST), ocgstyles <[EMAIL PROTECTED]> a écrit :
> I need to do that often at work when Windows files are moved over to > AIX. I just use vi. The key sequence is: > > :%s/^M// If you want to mimic dos2unix, you should use :%s/^M$// because those "^M" characters are only present at the end of lines (I mean, when you open a Windows-edited file in *nix). > To create the ^M character, press Ctrl+V, then M. I'm not sure what > that character is (never bothered to look), but I think may be that > extra control character that Windows uses to represent CRLF (carriage > return/line feed). Unix based system only use one control character. You're right, Unix based systems use only the line feed (LF) control character (which is represented by "\r" in Vim, BTW). You might want to read this [1] for further explanations. > I'm not sure if that affects Python at all. Testing out a simple > script with those characters shows that it doesn't matter... By experience, it doesn't affect imported module. However, it can affect an executable Python script (the one which is chmod +x and starts with "#!/usr/bin/env python"), if you want to execute it through "./you_script.py". In this case, it often returns a strange error like ": No such file or directory" > Keith - Jonathan [1] : http://en.wikipedia.org/wiki/Newline --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---