def python_script_exists(package=None, module=None):
 assert (module is not None)
 try:
  if (package is None):
   path = imp.find_module(module)[1]
  else:
   path = (osp.join(imp.find_module(package)[1], module) + '.py')
 except ImportError:
  return
 if (not osp.isfile(path)):
  path += 'w'
 if osp.isfile(path):
  return path

def python_script_exists ( package = None , module = None ) : assert ( module is not None ) try : if ( package is None ) : path = imp . find_module ( module ) [ 1 ] else : path = ( osp . join ( imp . find_module ( package ) [ 1 ] , module ) + '.py' ) except ImportError : return if ( not osp . isfile ( path ) ) : path += 'w' if osp . isfile ( path ) : return path
return absolute path if python script exists package=none -> module is in sys .