FAQ
One linha in tabela doesn't have the syntax "something:something" so
split() returns a 0 or 1 sized list and tmp[0] or tmp[1] points
outside the list.

2007/12/24, Vaurdan <armyportalrs at gmail.com>:
Hello,
I've this code:
def print_tabela(tabela):
print "Tabela 1 | Tabela 2"
for linha in tabela:
tmp = linha.split(":")
print tmp[0] + " | " + tmp[1],

But give me this error:
Tabela 1 | Tabela 2
Traceback (most recent call last):
File "./teste.py", line 126, in <module>
print_tabela(conteudo)
File "./teste.py", line 58, in print_tabela
print tmp[0] + " | " + tmp[1],
IndexError: list index out of range
--
Florencio Cano Gabarda

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 5 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedDec 24, '07 at 12:30p
activeDec 24, '07 at 12:53p
posts5
users5
websitepython.org

People

Translate

site design / logo © 2022 Grokbase