from pathlib import Path # rpd is a symbolic link >>> Path('rdp').is_symlink() True >>> Path('README').is_symlink() False