[Tutor] Reading in data files

paige crawford plcrawford at crimson.ua.edu
Mon Mar 14 20:08:30 CET 2011


Hey,


How do I read in a data file that has comments then remove the comments to
get to the numbers? The numbers in the data file needs to be read into a
list. There are also comments next to the numbers. The file looks something
like this

# DO NOT MODIFY
#
# This file is for the eyebrows
#
#  Read in these numbers
#
#
#

3 # This is the amount of items in each list, m

30        #  number 1
10        # number 3
-110     # number 9

39 40 30

48 390  # extra data
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110314/db80ab3a/attachment.html>


More information about the Tutor mailing list