faqts : Computers : Programming : Languages : Python : Common Problems : Files

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 26 people (85%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

What is the fastest way to search a binary file for a certain byte pattern (**** in my case)?

Jul 26th, 2000 05:09
unknown unknown, Bjorn Pettersen


Use:
import string
string.find( open('my_binary_file','rb').read(), '****' )