> >>> f = os.popen('file -bi test.py', 'r')
> >>> f.read().startswith('text')
sorry, it's not general, since "file -i" returns
"application/x-shellscript" for shell scripts,
it's better to go like that:
>>> import os
>>> f = os.popen('file test.py', 'r')
>>> f.read().find('text') != -1
--
bromden[at]gazeta.pl