Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Python for File Systems!
You have completed Python for File Systems!
Preview
Sometimes our files or directories aren't named correctly. Python provides us with a few functions for handling the changing of file and directory locations.
Python Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
I used to have a process for deploying new
versions of a site that was mostly built
0:00
about moving and renaming directories,
before restarting the server process,
0:01
so that it would find
the new version of a site.
0:05
Python provides us with a few functions
for handling the changing of file and
0:08
directory locations.
0:11
We're gonna look at two of these first.
0:12
Os.rename, and it's intermediate
friendly friend, os.renames.
0:14
With rename,
we can change the name of one item.
0:20
So we can say os.rename, and
I'm gonna rename bootstrap to assets.
0:23
And if I look in my directory over here,
I can see I have assets, and
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up