sphinx
Hi guys! I'm trying to create method to perform query at sphinx index, can anyone does something like this before? I appreciate ! Ageu -- *" 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
parsing in python
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
Re: parsing in python
Hi Dan, Thank you a lot =) Cheers Jayron 2011/8/3 Dan Stromberg > > 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 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/ -- http://mail.python.org/mailman/listinfo/python-list
Cursor.fetchall
Hi guys! I'm stuck at a problem, when I run the follow code: http://pastebin.com/4Gd9V325 I get this error: Traceback (most recent call last): File "/home/jayron/Downloads/grafos.py", line 49, in g, e = ministro_lei() File "/home/jayron/Downloads/grafos.py", line 24, in ministro_lei resp = Q.fetchall() AttributeError: 'long' object has no attribute 'fetchall' Please any help ? cheers -- *" 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
Re: Cursor.fetchall
Hi Felipe, I did, however I got this error: Traceback (most recent call last): File "/home/jayron/Downloads/grafos.py", line 48, in g, e = ministro_lei() File "/home/jayron/Downloads/grafos.py", line 34, in ministro_lei for i in G.degree(): TypeError: 'int' object is not iterable I could not understood what's going on, I've tried so many different approaches to solve this problem, but unfortunately no success. Cheers 2011/11/28 Felipe Vinturini > Hi Jayron, > > Instead of using "Q" to loop over the result, use: "dbcursor". > > resp = dbcursor.fetchall() > > I hope it helps. > > Regards, > Felipe. > > On Mon, Nov 28, 2011 at 9:54 AM, Jayron Soares wrote: > >> Hi guys! >> >> I'm stuck at a problem, when I run the follow code: >> >> http://pastebin.com/4Gd9V325 >> >> I get this error: >> >> Traceback (most recent call last): >> File "/home/jayron/Downloads/grafos.py", line 49, in >> g, e = ministro_lei() >> File "/home/jayron/Downloads/grafos.py", line 24, in ministro_lei >> resp = Q.fetchall() >> AttributeError: 'long' object has no attribute 'fetchall' >> >> Please any help ? >> >> cheers >> >> >> -- >> *" 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/ -- http://mail.python.org/mailman/listinfo/python-list