Python · Files & Paths (pathlib)

shutil.make_archive("test", "zip", "data") — what's the gotcha with the first argument, and what does it return?

Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.

Get it on App StoreGet it on Google Play

This is one card from the KnowCard library — thousands more across SAP, Linux, Python and more. In the app you get the answer, AI explanations, and cards that come back right before you would forget them. Free to start on iOS, Android or the web.

More in Files & Paths (pathlib)

What does os.path.splitext("archive.tar.gz") return?
After shutil.move("data", "backup/data"), the source is gone but you expected a copy. What does move actually do?
What is the difference between p.read_text() and open(p).read(), and when does each leave a file handle open?
A function does if Path(name).is_file(): process(name). The file exists but the branch never runs. What's the most likely cause?
What does os.path.basename("/usr/include/") return — and why might it surprise you?
What does this return, and what's the trap? ``` import os.path os.path.join("/home/me", "/etc", "x") ```

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play