Moving the Files
So are you ready to run the script? Go ahead and press F5, save the file, and the script ran. I don’t know whether anything changed, but let’s head over to the file system and take a look. Inside of
copy_dir/, now I have the
images/ folder, and all the images are in there.
00:37 Let’s double-check in some code on the REPL as well. Let’s do this similar to how we did before. I’m going to search through the directory that is not images, so inside of the documents directory, and let’s figure out whether there’s any image files left in there.
then I want to print the
path.name. Is there anything in there? Nothing. And if I run the same thing for files,
files_dir = practice_dir and—oh no, not
files, sorry. It’s called
"images". There you go.
This might be a good point to move over from
practice_dir. But before you do this, in the next lesson, let’s do one last test round and also clean up the script file a bit to remove all the code comments that you used for development, and then finally also run it on the actual directory structure.
Become a Member to join the conversation.