What is the purpose of this
names = list;
? Also, no ;
required in Python.
Do you want
names = []
or
names = list()
at the start of your program instead? Though given your particular code, there's no need for this statement to create this names
variable since you do so later when you read data into it from your file.
@JBernardo has already pointed out the other (and more major) problem with the code.