parsing in python

Jayron Soares jayronsoares at gmail.com
Wed Aug 3 19:05:36 CEST 2011


Hi Dan,

Thank you a lot =)
Cheers
Jayron

2011/8/3 Dan Stromberg <drsalists at gmail.com>

>
> To just split lines into words, you could probably just use a regex.
>
> If you need to match things, like quotes or brackets or parens, pyparsing
> is pretty nice.
>
> On Wed, Aug 3, 2011 at 6:26 AM, Jayron Soares <jayronsoares at gmail.com>wrote:
>
>> Hi folks,
>>
>> 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.
>> Please some could share some tips to do it?
>> Cheers
>> Jayron
>> here is the code:
>>
>> # -*- conding: utf-8 -*-
>>
>>
>> from subprocess import Popen, PIPE
>>
>> pesquisa = raw_input(" Digite a pesquisa de interesse: ")
>>
>> def Pesquisar(pesquisa):
>>     p = Popen(["search", pesquisa],stdout=PIPE)
>>     resultado = p.communicate()[0]
>>     return resultado
>>
>>
>> print Pesquisar(pesquisa)
>>
>>
>>
>>
>> --
>> *" A Vida é arte do Saber...Quem quiser saber tem que Estudar!"*
>>
>> http://bucolick.tumblr.com
>> http://artecultural.wordpress.com/
>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>


-- 
*" A Vida é arte do Saber...Quem quiser saber tem que Estudar!"*

http://bucolick.tumblr.com
http://artecultural.wordpress.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110803/4fe744c9/attachment.html>


More information about the Python-list mailing list