In general, I encourage the use of astropy to read datafiles. Here is an example from HW #1 of code that will do that.
from astropy.io import ascii
datasite='http://burro.case.edu/Academics/Astr222/HW/HW1/'
datafile='stable.dat'
# this next line loads the data into an astropy table,
telling astropy
# that the data starts at the first non-commented line,
and the column names
# start two lines before that
starcounts=ascii.read(datasite+datafile,header_start=-2,data_start=0)
print(starcounts.colnames) # will list the column names
vmag=starcounts['V']
bmvcolor=starcounts['B-V']
plt.scatter(bmvcolor,vmag)
You can also see the format of the datafile just by pointing your browser at it (like this: http://burro.case.edu/Academics/Astr222/HW/HW1/stable.dat), and you can then edit the ascii.read call as appropriate if the format looks different (maybe there are three header lines instead of two, for example).