Starting to Write the Script
Let’s get started with some Python scripting. Okay, so here’s my overall task, and I’m going to start by breaking it out into subtasks. So again, I’m going to want to import—
import Path—and then I want to create a subfolder called
So these are two tasks that I see here in the overall challenge. I already decided I want to use
pathlib for this. I did the import, and now I’m going to get started on the first task, which is to create a subfolder called
images/. Okay, subfolder to what? All right, we have a new folder in the
practice_files/ folder. Okay, so I need access to the
That’s another task that I need to do before: get path to the
practice_files/ folder. And then I want to create a subfolder. And then I want to move all image files to that folder. Step one, get the path to the
practice_files/ folder. Okay, so I already did that over here.
So this defines the path based on, like, that is located inside of my home directory and then inside of
python_basics_exercises/ in a folder called—it’s a little off the screen, but there it is—
Become a Member to join the conversation.