In numpy.core.numeric.py you will find loadtxt, which uses the following:: line = line[:line.find(comments)].strip()
I believe there is a bug here (when a line has no comment). To illustrate:: >>> line = "12345" >>> comments = "#" >>> line[:line.find(comments)] '1234' So I propose this should be:: try: line = line[:line.index(comments)].strip() except ValueError: line = line.strip() Am I right? Cheers, Alan Isaac _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion