<br><br><div class="gmail_quote">On Thu, Dec 25, 2008 at 7:02 AM, James Stroud <span dir="ltr"><<a href="mailto:jstroud@mbi.ucla.edu">jstroud@mbi.ucla.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Stef Mientki wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hello,<br>
<br>
Is there a function to remove escape characters from a string ?<br>
(preferable all escape characters except "\n").<br>
<br>
thanks,<br>
Stef<br>
</blockquote>
<br>
<br></div>
</blockquote><div><br>import string<br><br>test = 'this\r is a test\t yeah\n'<br><br>for c in string.printable[-5:]:<br>     if c != '\n':<br>        test = test.replace(c, ' ')<br><br><br>Hmm, should the escape codes be in their own little list in string? Or are they, and I'm just not seeing them? Is string.printable[-5:] a reliable way to get the list of escape codes? <br>
</div></div><br>