"Bryan Fodness" <[EMAIL PROTECTED]> wrote > First, I get different outputs from the two methods below. > > for line in file('file.dcm', 'rb'): > print line
This prints each line in turn. > inp = open('file.dcm', 'rb') > print inp.readlines() This prints a list of lines > Second, I have never tried to parse a binary file. I could use a > few hints > to get started. Take a look at my File handling topic which gives a simple example. (about 2/3 of the way down) Basically the key is to know what the data looks like and define a struct pattern to match. Note that the data may well not be accessible using readline, you may need to use read with an length argument. See help(read)... -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor