jvdb schrieb: > Hi all, > > I need some help on the following issue. I can't seem to solve it. > > I have a binary (pcl) file. > In this file i want to search for specific codes (like <0C>). I have > tried to solve it by reading the file character by character, but this > is very slow. Especially when it comes to files which are large > (>10MB) this is consuming quite some time. > Does anyone has a hint/clue/solution on this?
What has the searching to do with the reading? 10MB easily fit into the main memory of a decent PC, so just do contents = open("file").read() # yes I know I should close the file... print contents.find('\x0c') Diez -- http://mail.python.org/mailman/listinfo/python-list