Ode to .shutil.move() – ‘Oh how you frustrate me’

In Hackbright, we had a project from our first week that I was finishing this weekend, and it asked us to use the .shutil.move() function. Based on the reading for this function (linked above), it says “The destination directory must not already exist.” This threw me off for a while because you should have the directory already existing to move a file to it.

My experience with coding it and understanding at this point is that you need to create the directory before you reference it in the function and the quote I pulled is more to warn that if something already exists, it will be overwritten. If anyone has a different take on this function let me know and I’ll update the post.

The main take-away for me from this was despite lots of searching, I had a hard time finding something that gave a clear explanation on this topic and I should have asked my fellow classmates for help.

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s