<br>To just split lines into words, you could probably just use a regex.<br><br>If you need to match things, like quotes or brackets or parens, pyparsing is pretty nice.<br><br><div class="gmail_quote">On Wed, Aug 3, 2011 at 6:26 AM, Jayron Soares <span dir="ltr"><<a href="mailto:jayronsoares@gmail.com">jayronsoares@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi folks,<div><br></div><div>I've created a simple method to grab files texts from directory by words random, however I figure out that I need extract the content inside of each file, in fact I believe I have to create a parsing, nonetheless I don't know how to create a parser.</div>
<div>Please some could share some tips to do it?</div><div>Cheers</div><div>Jayron</div><div>here is the code:</div><div><br></div><div><div># -*- conding: utf-8 -*-</div><div><br></div><div><br></div><div>from subprocess import Popen, PIPE</div>
<div><br></div><div>pesquisa = raw_input(" Digite a pesquisa de interesse: ")</div><div><br></div><div>def Pesquisar(pesquisa):</div><div> p = Popen(["search", pesquisa],stdout=PIPE)</div><div> resultado = p.communicate()[0]</div>
<div> return resultado</div><div><br></div><div><br></div><div>print Pesquisar(pesquisa)</div></div><div><br></div><font color="#888888"><div><br></div><div><br clear="all"><br>-- <br><i><font color="#006600">" A Vida é arte do Saber...Quem quiser saber tem que </font><font color="#ff0000"><b>Estudar</b></font><font color="#006600">!"</font></i><div>
<br></div><div><a href="http://bucolick.tumblr.com/" target="_blank">http://bucolick.tumblr.com</a></div><div><a href="http://artecultural.wordpress.com/" target="_blank">http://artecultural.wordpress.com/</a></div><br>
</div>
</font><br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br>