Researching the Documentation
I kind of, like, want to be able to test frequently and often. This was one of the tips that I wrote down also on the slide. And now I’m thinking, okay, so I have a
practice_files/ folder that I want to do some operations on.
But once I move some files, the
practice_folder/ is going to look different than before. So if I want to test often, but I do file system operations, I’m kind of changing the state of the folder structure that I’m interacting with, right?
That would allow me to test more freely and more often, but still have the intact file structure to then run my final script on. Basically, if you went through the course, you might remember that deleting a folder recursively with content wasn’t possible with
01:08 Now I’m wondering it might be a similar situation if I do want to copy a folder recursively with content in it. So what can I do? In this case, maybe I don’t exactly know what the right function is for that or even which module I should use, so I would head over to my search engine and just do a little bit of research and figure out if I can find a good solution for this task.
I might just go to my search bar and then think about what do I want to do. I want to copy a folder in Python, maybe
pathlib, but it’s important that it’s recursively, and often, I like to go to the documentation.
So let’s see what I get here. And can I see anything? So I scroll a little to look for
docs.python, and here I have again the
shutil module that I’ve already used to recursively delete a folder. So that might be a good solution.
Become a Member to join the conversation.