Query regarding grep!!

B

bhavya sg

Hi,

I saw in PEP4 of python 2.5 that grep module has gone
obsolete in perl 2.5. But I am not able to find an
alternative for that.My doubt is "are the other forms
of grep like egrep and ggrep be used instead"?

cheers,
Spurthi




__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/
 
N

Nick Vatamaniuc

Of course you can always use grep as an external process (if the OS has
it). For example:

-------------------------------------------------------------------
In [1]: import subprocess

In [2]: out=subprocess.Popen( 'grep -i blah ./tmp/*',
stdout=subprocess.PIPE, shell=True ).communicate()[0]

In [3]: out
Out[3]: './tmp/ex.tex:Blah blah blah...\n'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,267
Latest member
WaylonCogb

Latest Threads

Top