def __init__(self):
self.oMagic=magic.Magic(magic_file=r'C:\Program Files (x86)\GnuWin32\share\misc\magic')
filename = os.path.join(os.path.dirname(sys.argv[0]), 'file-magic.def')
if os.path.isfile(filename):
# self.oMagicCustom=magic.Magic(magic_file=r'mymagic', keep_going=True)
self.oMagicCustom = magic.Magic(magic_file=filename)
else:
print('Warning: custom magic file not found: %s' % filename)
self.oMagicCustom = None
评论列表
文章目录