Code to recognize MS-Word document files?

WP warrenpstma at _______.com.hotmail
Tue Mar 4 18:02:50 CET 2003


WP wrote:
> 
> Extremely Bogus Hack: (probably no help, sorry!)
> 
>     f=open(wordfilename,'rb')
>     str1=f.read(10) # arbitrary # of bytes
>     for i in str1:
>         hex = hex + ( '%02x ' % Ord(i) )
>     if hex='d0 cf 11 e0 a1 b1 1a e1 00 00 ':
>         print 'match'
I meant if hex==
This is what always happens when one types something pedantic and doesn't try
running it first.
Probably this code still doesn't run. (That's how bogus it is.)

Warren


-- 
--------------------------------------
warren.postma at adaptivenetworks.on.ca
Toronto Ontario Canada






More information about the Python-list mailing list