Can the cd command in Python be used to change directories like in the terminal?

22 Replies, 1400 Views

Yo! The cd command Python version is `os.chdir()`, but it’s not as instant as the terminal.

If you’re curious why it’s not the same, it’s because Python is a scripting language, not a shell. They’re built for different purposes.

Btw, check out [Python’s official docs](https://docs.python.org/3/library/os.html) for more deets on `os.chdir()`.

Messages In This Thread



Users browsing this thread: 1 Guest(s)