r=re.compile(r"(\(')|( '\))|'")<br>print r.sub('',str(output))<br><br><div><span class="gmail_quote">On 8 Feb 2006 18:35:01 -0800, <b class="gmail_sendername"><a href="mailto:eight02645999@yahoo.com">eight02645999@yahoo.com
</a></b> <<a href="mailto:eight02645999@yahoo.com">eight02645999@yahoo.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi<br>i have some output that returns a lines of tuples egtr<br><br>('sometext1', 1421248118, 1, 'P ')<br>('sometext2', 1421248338, 2, 'S ')<br>and so on<br>....<br><br>I tried this<br>re.sub(r" '() ",'',str(output)) but it only get rid of the ' and not
<br>the braces. I need to write the output to a file such that<br><br>sometext1, 1421248118, 1, P<br>sometext2, 1421248338, 2, S<br><br>I also tried escaping , re.sub(r" '\(\) ",'',str(output)) but also did<br>not work
<br>How can i get rid of the braces before writing to file? thanks<br><br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br>