Path
A path is a file's address on your computer: the folders you go through to reach it, ending in the file's name, like projects/python-for-altair/life_expectancy.csv.
Select any words here to ask your Maestro about them.
A path can be absolute, starting from the top of the disk (/Users/ana/projects/... on a Mac, C:\Users\ana\... on Windows), or relative, starting from the folder you're working in. "life_expectancy.csv" on its own is a relative path: the file with that name, right here.
Python's pathlib turns a path into an object you can ask things of:
from pathlib import PathPath("life_expectancy.csv").exists()When Python says FileNotFoundError, the path points somewhere the file isn't. The working directory is the first thing to check.
Ask your Maestro about Path
It answers from a free course page that uses this word, the way it answers while you study.
You: What does "Path" mean, in plain words?
Your Maestro: I'll explain it with a case of yours: it sticks better than a definition. Want to see why Python can't find your file?
Asking about: Answers from the page "What's a folder, and what's a file path?"
Only this browser keeps what you ask here. How it works
In Maestro's courses
Learn more
Related terms
- Working directory
The working directory is the folder a program treats as "here". A file name with no folders in front of it, like life_expectancy.csv, is looked for in that folder.