def _complete_path(path=None):
 if (not path):
  return _listdir('.')
 (dirname, rest) = os.path.split(path)
 tmp = (dirname if dirname else '.')
 res = [p for p in _listdir(tmp) if p.startswith(rest)]
 if ((len(res) > 1) or (not os.path.exists(path))):
  return res
 if os.path.isdir(path):
  return [p for p in _listdir(path)]
 return [(path + ' ')]

def _complete_path ( path = None ) : if ( not path ) : return _listdir ( '.' ) ( dirname , rest ) = os . path . split ( path ) tmp = ( dirname if dirname else '.' ) res = [ p for p in _listdir ( tmp ) if p . startswith ( rest ) ] if ( ( len ( res ) > 1 ) or ( not os . path . exists ( path ) ) ) : return res if os . path . isdir ( path ) : return [ p for p in _listdir ( path ) ] return [ ( path + ' ' ) ]
perform completion of filesystem path .