Linux endline

Fabien Henon ffjhenon at club-internet.fr
Sun Mar 17 16:51:25 EST 2002


Fredrik Lundh wrote:

> Fabien Hénon wrote:
> 
>>1° When I use it under Linux I would like to get rid of the \r which
>>appears at the end of each line. ( I know there is a difference of
>>endline between Windows, Mac and Linux).
>>
> 
> how about
> 
> if line.endswith("\r\n"):
>     # deal with DOS file ending
>     line = line[:-2] + "\n"
> self.text.insert(END, line)
> 
> 
>>3° Is there a way to fire up an external application (like POV or a
>>modeler) in background
>>
> 
> look up "os.spawn" in the library reference.
> 
> </F>
> 
> <!-- (the eff-bot guide to) the python standard library:
> http://www.pythonware.com/people/fredrik/librarybook.htm
> -->
> 
> 

Thanks I'll give it a try.

Fabien




More information about the Python-list mailing list