def have_python_version(name, cache={}):
 if (name not in cache):
  cache[name] = (os.system((name + ' -c "import test.test_support"')) == 0)
 return cache[name]

def have_python_version ( name , cache = { } ) : if ( name not in cache ) : cache [ name ] = ( os . system ( ( name + ' -c "import test.test_support"' ) ) == 0 ) return cache [ name ]
check whether the given name is a valid python binary and has test .