testing the data-type of a stream

David Bear david.bear at asu.edu
Wed Sep 17 05:53:28 CEST 2003


I'm writing a filter and would like to be able to do what the Linux
'file' command does, i.e. look at a couple of bytes to see what kind of
data I'm dealing with, the branch based on the type. 

I scanned the python library and couldn't find anything that seemed to
approximate this.  I know I could do os.popen and call the file
command then parse the output, but would rather not if there is a
regular python module that can do it for me.

any recommendations?

--
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"




More information about the Python-list mailing list