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
Python has some great tools to simplify path creation. We'll learn how to automate this potentially tedious task.
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
operating system you're on, you also
have to deal with many other things.
0:00
Not all OSs care about upper or
lowercase letters.
0:00
Some softly enforce a character limit for
file and directory names.
0:03
Some require an extension for files, or
0:06
won't allow special characters
in directory names.
0:08
And then someone gives
you a relative path and
0:11
expects you to get to
the right place with it.
0:12
Users, am I right?
0:14
Well, you've probably heard
me say it before, and
0:15
you'll probably hear me say it again,
Python loves us and wants us to be happy.
0:17
And because of that,
we have the wonderful os.path.join tool.
0:20
Come on, let me show you how to use it.
0:24
All right, let's start right where we are.
0:25
I've imported os, I'm gonna do os.getcwd,
and I've got my file system's directory.
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