From the course: Python: Recursion

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

A note about file paths

A note about file paths - Python Tutorial

From the course: Python: Recursion

A note about file paths

- [Instructor] When I first recorded this course, I was using Python, and my configuration allowed me to overlook a potential problem, and I want to remedy that now. So this applies to just a handful of the files in the course that is oh 03_03/gcd.py, and the others that you can see on the screen. Now, the issue has to do with the import path for a module, which I've provided called Trace Recursion. It turns out that Python had actually added this path automatically, and the way that I did it in the code is not actually optimal, and it's certainly not going to work on Codespaces. So what I've done is I've gone through the repo and I've updated it. So all the relevant files now have this slightly altered version of that bit of code. So we're using sys.path.insert(0, './') this is for Linux. So this tells the interpreter to include in its path folders, which are in the parent directory, and that trace_recursion, rather than copying it into every single folder, I just had it copied once…

Contents