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
We need to find the directory of where our project is being built.
This video doesn't have any notes.
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
So let's start off with def main, and
we'll say that this is our Entrypoint.
0:00
And then down here, we'll do our
normal if __name__ == __main__.
0:05
And then we'll run main.
0:12
We'll start with just a single entry point
which we'll run when the script is run
0:13
directly.
0:18
So first, I wanna get the path for
the project.
0:19
Now, since I need to make sure that
the user gives me something like a path,
0:22
it should really be an absolute path.
0:25
I think I wanna bring in pathlib.
0:26
I also think I'll do
this in a new function.
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