Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Question

Status
Not open for further replies.

komyg

Programmer
Dec 13, 2005
68
BR
Hi, I am totally new to Python and I am making a script that parses a file.

I try to find a regular expression in the file with: expr.match(line), and that works just fine.

The problem is that I don't want to print this line that has the regular expression, so in Java I would do:

if(!expr.match(line))
{
...
// print the other lines
...
}

How can I do this in Python?

Thanks,
Komyg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top