結果 : check if path is valid python