On 14/07/2011 21:53, Peter Otten wrote:
MRAB wrote:

for line2 in nxxReg.findall(soup):
     nxxlist.insert(count2, line2)
     count2 = count2 + 1

enumerate will help you here:

for count2, line2 in enumerate(nxxReg.findall(soup)):
     nxxlist.insert(count2, line2)

An insert() at the end of a list is usually spelt append() in Python ;)
If you are looking for something less baroque

nxxlist = nxxReg.findall(soup)

will do, too.

That's true... :-)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to