On this page
  1. genericpath.exists
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

genericpath.exists

Prev: genericpath.commonprefix | Up: genericpath | Next: genericpath.getatime
Rel: genericpath.commonprefix, genericpath.getatime, genericpath.getctime, genericpath.getmtime
Ref: docs.python.org — genericpath.exists
Tags: #public #python3 #stdlib #genericpath


Import

import genericpath
from genericpath import exists

Signature & Overview

genericpath.exists(path)

Test whether a path exists. Returns False for broken symbolic links

Usage

import os
from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as tmp:
    assert os.path.exists(tmp) is True

Gotchas

REPL Inspect

from genericpath import exists
help(exists)

Linked from

Related notes