Aug-21-2018, 04:03 PM
Thanks.
So I removed 2.7.14, installed 3.7.0*, re-ran the code, and… same error: Wrong number of hits:
So I removed 2.7.14, installed 3.7.0*, re-ran the code, and… same error: Wrong number of hits:
import re,sys,locale # Open file f = open('input.gpx', 'r') #GOOD strings = re.findall(r'<trk>', f.read()) #Only 27! #BAD strings = re.findall(r'<trk>.+?</trk>', f.read()) #Only 27! p = re.compile(r'(<trk>.+?</trk>)',re.MULTILINE) strings = p.findall(f.read()) f.close() if strings: #27 instead of 348! print("Number of items : " + str(len(strings)))* Checked that "python -V" returns "Python 3.7.0"