![]() |
|
|
|
#1 |
|
Michael Savarese wrote:
> I'm a python newbie and I'm trying to test several regular expressions on > the same line before moving on to next line. > it seems to move on to next line before trying all regular expressions which > is my goal. > it only returns true for first regular expression > does the curser have to be rest to beginning of line? If so, how would I do > that. > remember I'm new > thanks in advance to any advice > Mike S. > > the following is part of my code, > readThis=open('c:/9320.txt','r') > > for line in readThis: > try: > thisKey = key.search(line).group(1) > thisMap = map.search(line).group(1) > thisParcel = parcel.search(line).group(1) > except: > continue > > The bare except will hide any errors in the lines above it. Either catch errors that you expect or take the try-except out. -- Kindest regards. Mark Lawrence. Mark Lawrence |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Horizontal Lines on Cartoon dvd's | Roger Hammonds | DVD Video | 1 | 10-07-2006 03:43 PM |
| Is there a tool to locate duplicate lines in a file ? | rofarmer | Software | 0 | 08-17-2006 06:58 PM |
| Walt Disney Treasures - ON THE FRONT LINES - DVD REVIEW | Mike McGee | DVD Video | 25 | 05-13-2004 07:06 PM |
| JVC HRXVC44U DVD/VCR combo and seeing scan lines | Eric B | DVD Video | 0 | 05-05-2004 07:45 PM |
| Re: Is Anchor Bay 2nd Best After Criterion ? | Grand Inquisitor | DVD Video | 8 | 08-23-2003 03:40 PM |