def isPackageDirectory(dirname):
 for ext in zip(*imp.get_suffixes())[0]:
  initFile = ('__init__' + ext)
  if os.path.exists(os.path.join(dirname, initFile)):
   return initFile
 return False

def isPackageDirectory ( dirname ) : for ext in zip ( * imp . get_suffixes ( ) ) [ 0 ] : initFile = ( '__init__' + ext ) if os . path . exists ( os . path . join ( dirname , initFile ) ) : return initFile return False
is the directory at path dirname a python package directory? returns the name of the __init__ file if dirname is a package directory .