# -*- coding: utf-8 -*-
"""
Created on Wed Sep 20 07:44:11 2017
@author: Srinu
"""
import re
#opening the file in read mode
f=open('D:\EDUCATION\python\google-python-exercises\\babynames\\baby2008.html','r')
#Trying to extract the details like rank,firstname,lastname from the file
tuples=re.findall(r'<td>(\d+)</td><td>(\w+)</td><td>(\w+)</td>','f.read()')
#printing the extracted lists [rank,firstname,lastname]
print(tuples)
error:
runfile('D:/EDUCATION/python/my progs/strs.py', wdir='D:/EDUCATION/python/my progs')
list is not printing
"""
Created on Wed Sep 20 07:44:11 2017
@author: Srinu
"""
import re
#opening the file in read mode
f=open('D:\EDUCATION\python\google-python-exercises\\babynames\\baby2008.html','r')
#Trying to extract the details like rank,firstname,lastname from the file
tuples=re.findall(r'<td>(\d+)</td><td>(\w+)</td><td>(\w+)</td>','f.read()')
#printing the extracted lists [rank,firstname,lastname]
print(tuples)
error:
runfile('D:/EDUCATION/python/my progs/strs.py', wdir='D:/EDUCATION/python/my progs')
list is not printing