Linux endline
Fredrik Lundh
fredrik at pythonware.com
Sat Mar 16 11:50:20 EST 2002
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
-->
More information about the Python-list
mailing list