On 31/10/2012 01:01, Brayden Zhao wrote:
def fieldict(filename):
D={}
with open(filename) as FileObject:
for lines in FileObject:
linelist=lines.split('\t')
Key=linelist[0]
ValCity=(linelist[12]).strip()
ValState=linelist[13]
ValOne=linelist[2]
ValTwo=linelist[6]
ValThree=boolean(linelist[7])
D={Key:(ValOne, ValTwo, ValThree, ValCity,ValState)}
Put the line above inside the for loop :)
return D
print fieldict("DOT500.txt")
--
Cheers.
Mark Lawrence.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor